Go #52
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: Go | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| client-build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.22" | |
| cache: true | |
| - name: Run Go generators | |
| run: go generate ./.../gen | |
| - name: Ensure generated code is clean | |
| run: git diff --exit-code | |
| - name: Run Go vet | |
| run: go vet ./... | |
| - name: Build Go | |
| run: go build ./... | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v1.12.0 | |
| - name: Run Go tests | |
| run: gotestsum | |
| - name: Install govulncheck | |
| run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.1 | |
| - name: Run govulncheck | |
| run: govulncheck ./... | |
| continue-on-error: true | |
| client-scan: | |
| if: github.event_name != 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: securego/gosec@v2.19.0 | |
| with: | |
| args: ./... | |
| client-lint: | |
| if: github.event_name != 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.22" | |
| cache: true | |
| - name: Run Go generators | |
| run: go generate ./.../gen | |
| - name: Install golint | |
| run: go install golang.org/x/lint/golint@latest | |
| - name: Run golint | |
| run: golint ./... |