Add CI workflow for PRs to main #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Golang | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Install gofumpt | |
| run: go install mvdan.cc/gofumpt@latest | |
| - name: Run go mod tidy | |
| run: go mod tidy | |
| - name: Run go mod vendor | |
| run: go mod vendor | |
| - name: Run gofumpt against code | |
| run: gofumpt -l -w . | |
| - name: Ensure no modified or uncommitted files | |
| run: | | |
| git add . | |
| git diff --staged --exit-code |