chore(ci)(deps): bump actions/checkout from 6.0.3 to 7.0.0 #32
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: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| GO_VERSION: "1.26" | |
| jobs: | |
| detect: | |
| name: detect go source | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has-source: ${{ steps.detect.outputs.has-source }} | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Detect Go source | |
| id: detect | |
| shell: bash | |
| run: | | |
| if find . -name '*.go' \ | |
| -not -path './.*' \ | |
| -not -path './vendor/*' \ | |
| -not -path '*/testdata/*' \ | |
| -print -quit | grep -q .; then | |
| echo "has-source=true" >> "$GITHUB_OUTPUT" | |
| echo "Go source detected — full CI will run." | |
| else | |
| echo "has-source=false" >> "$GITHUB_OUTPUT" | |
| echo "No Go source yet — lint/test/build steps will be skipped." | |
| fi | |
| lint: | |
| name: lint | |
| needs: detect | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: go mod verify | |
| run: go mod verify | |
| - name: go mod tidy -diff | |
| run: | | |
| diff=$(go mod tidy -diff) | |
| if [ -n "$diff" ]; then | |
| echo "go.mod / go.sum drift detected; run 'go mod tidy' and commit." | |
| echo "$diff" | |
| exit 1 | |
| fi | |
| - name: gofmt | |
| if: needs.detect.outputs.has-source == 'true' | |
| run: | | |
| unformatted=$(gofmt -l .) | |
| if [ -n "$unformatted" ]; then | |
| echo "Unformatted files:" | |
| echo "$unformatted" | |
| echo "Run 'go tool goimports -w -local github.com/plexara/plexara-agents .' and commit." | |
| exit 1 | |
| fi | |
| - name: go vet | |
| if: needs.detect.outputs.has-source == 'true' | |
| run: go vet ./... | |
| - name: golangci-lint config verify | |
| run: go tool golangci-lint config verify | |
| - name: golangci-lint | |
| if: needs.detect.outputs.has-source == 'true' | |
| run: go tool golangci-lint run ./... | |
| test: | |
| name: test (${{ matrix.os }}) | |
| needs: detect | |
| if: needs.detect.outputs.has-source == 'true' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Test (race + shuffle + coverage) | |
| run: | | |
| go test -race -shuffle=on -count=1 \ | |
| -covermode=atomic \ | |
| -coverprofile=coverage.out \ | |
| ./... | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.out | |
| flags: core | |
| # Set to true once the repository is registered with Codecov. | |
| # See docs/ci.md "Codecov registration" for the one-time setup. | |
| # Until then, upload failures are non-fatal so they cannot block | |
| # an otherwise-clean PR. | |
| fail_ci_if_error: false | |
| build: | |
| name: build (${{ matrix.goos }}/${{ matrix.goarch }}) | |
| needs: detect | |
| if: needs.detect.outputs.has-source == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| - goos: windows | |
| goarch: amd64 | |
| env: | |
| CGO_ENABLED: "0" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| steps: | |
| - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| cache: true | |
| - name: Build | |
| run: go build -trimpath ./... | |
| ci-pass: | |
| name: ci pass | |
| needs: [lint, test, build] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Aggregate | |
| run: | | |
| if [ "${{ needs.lint.result }}" != "success" ]; then | |
| echo "lint failed"; exit 1 | |
| fi | |
| if [ "${{ needs.test.result }}" != "success" ] && [ "${{ needs.test.result }}" != "skipped" ]; then | |
| echo "test failed"; exit 1 | |
| fi | |
| if [ "${{ needs.build.result }}" != "success" ] && [ "${{ needs.build.result }}" != "skipped" ]; then | |
| echo "build failed"; exit 1 | |
| fi | |
| echo "ci passed" |