Seed the skills sync with per-source manifests and the skills/ layout #141
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Check formatting | |
| run: test -z "$(gofmt -l .)" || (echo "Run 'gofmt -w .' to fix formatting" && gofmt -l . && exit 1) | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Check go.mod tidiness | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod go.sum | |
| - name: Test | |
| run: go test -v ./... | |
| - name: Test the skills sync | |
| run: seed/scripts/test-sync-skills.sh | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: v2.9.0 | |
| lint-actions: | |
| name: GitHub Actions audit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Run actionlint | |
| uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 | |
| with: | |
| advanced-security: false | |
| security: | |
| name: Govulncheck | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install govulncheck | |
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | |
| - name: Run govulncheck | |
| run: govulncheck ./... | |
| test-race: | |
| name: Test (race detector) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Test with race detector | |
| run: go test -race -v ./... | |
| benchmarks: | |
| name: Benchmarks | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 2 | |
| persist-credentials: false | |
| - name: Check for benchmark-relevant changes | |
| id: filter | |
| uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 | |
| with: | |
| filters: | | |
| bench: | |
| - '**/*.go' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - name: Set up Go | |
| if: steps.filter.outputs.bench == 'true' | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run benchmarks | |
| if: steps.filter.outputs.bench == 'true' | |
| run: | | |
| set -o pipefail | |
| go test -bench=. -benchmem -count=3 ./... | tee benchmarks.txt | |
| - name: Download previous benchmark baseline | |
| if: steps.filter.outputs.bench == 'true' | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: benchmarks-baseline.txt | |
| key: benchmarks-baseline-${{ github.sha }} | |
| restore-keys: | | |
| benchmarks-baseline- | |
| - name: Install benchstat | |
| if: steps.filter.outputs.bench == 'true' | |
| run: go install golang.org/x/perf/cmd/benchstat@latest | |
| - name: Compare benchmarks | |
| if: steps.filter.outputs.bench == 'true' && hashFiles('benchmarks-baseline.txt') != '' | |
| run: | | |
| echo "## Benchmark Comparison" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| benchstat benchmarks-baseline.txt benchmarks.txt >> "$GITHUB_STEP_SUMMARY" 2>&1 || true | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| - name: Check for significant regression | |
| if: steps.filter.outputs.bench == 'true' && hashFiles('benchmarks-baseline.txt') != '' | |
| run: | | |
| benchstat benchmarks-baseline.txt benchmarks.txt > comparison.txt 2>&1 || true | |
| if grep -E '\+[2-9][0-9]\.[0-9]+%|\+[1-9][0-9][0-9]+' comparison.txt; then | |
| echo "::error::Performance regression detected (≥20% slower). See benchmark comparison in step summary." | |
| exit 1 | |
| fi | |
| - name: Save benchmark baseline | |
| if: steps.filter.outputs.bench == 'true' | |
| run: cp benchmarks.txt benchmarks-baseline.txt | |
| - name: Cache benchmark baseline | |
| if: steps.filter.outputs.bench == 'true' | |
| uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: benchmarks-baseline.txt | |
| key: benchmarks-baseline-${{ github.sha }} | |
| - name: Upload benchmark results | |
| if: steps.filter.outputs.bench == 'true' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: benchmarks | |
| path: benchmarks.txt | |
| retention-days: 30 |