ci: switch to flow gha #2
Workflow file for this run
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: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| permissions: | |
| contents: read # for actions/checkout to fetch code | |
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "^1.24" | |
| - uses: jahvon/flow-action@v1.0.0-beta1 | |
| with: | |
| executable: 'lint --param CI=true' | |
| timeout: '5m' | |
| flow-version: 'main' | |
| - name: Upload SARIF file | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: lint.sarif | |
| category: golangci-lint | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "^1.24" | |
| - uses: jahvon/flow-action@v1.0.0-beta1 | |
| with: | |
| executable: 'test --param CI=true' | |
| timeout: '5m' | |
| flow-version: 'main' | |
| - name: Upload to codecov | |
| uses: codecov/codecov-action@v3 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| file: coverage.out | |
| fail_ci_if_error: true | |
| validate-generated: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "^1.24" | |
| - name: Install mockgen | |
| run: go install go.uber.org/mock/mockgen@v0.4.0 | |
| - uses: jahvon/flow-action@v1.0.0-beta1 | |
| with: | |
| executable: 'generate' | |
| timeout: '10m' | |
| flow-version: 'main' | |
| - name: Check for uncommitted changes | |
| uses: jahvon/flow-action@v1.0.0-beta1 | |
| with: | |
| executable: 'validate generated' | |
| timeout: '2m' | |
| flow-version: 'main' | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "^1.24" | |
| - uses: jahvon/flow-action@v1.0.0-beta1 | |
| with: | |
| executable: 'scan security' | |
| timeout: '10m' | |
| flow-version: 'main' | |
| - name: Upload govuln SARIF file | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: govuln.sarif |