Repository navigation
feat(release): harden template delivery workflows #58
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: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| name: Build, test, lint, and scan | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.go == '1.27rc1' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ["1.25", "1.26", "1.27rc1"] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version: ${{ matrix.go == '1.27rc1' && '1.27.0-rc.1' || format('{0}.x', matrix.go) }} | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run golangci-lint | |
| if: matrix.go != '1.27rc1' | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: v2.12.2 | |
| - name: Run tests | |
| run: go test -race -v -coverprofile=coverage.txt ./... | |
| - name: Show coverage summary | |
| run: go tool cover -func=coverage.txt | tail -1 | |
| - name: Upload coverage report | |
| if: matrix.go == '1.26' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage-report | |
| path: coverage.txt | |
| retention-days: 30 | |
| if-no-files-found: error | |
| - name: Build plugin binary | |
| run: go build -v ./cmd/plugin | |
| - name: Run Trivy filesystem scan | |
| if: matrix.go == '1.26' | |
| uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| format: table | |
| exit-code: '1' | |
| ignore-unfixed: true | |
| severity: CRITICAL,HIGH | |
| actionlint: | |
| name: Validate GitHub Actions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| - name: Run actionlint | |
| uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0 | |
| - name: Verify release workflow invariants | |
| run: python3 scripts/verify-release-workflow.py |