build(deps): bump dawidd6/action-download-artifact from 20 to 21 #520
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: Go | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP')) | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Run go vet | |
| run: go vet ./internal/... | |
| - name: Run tests | |
| # Use Go 1.20+ binary coverage format via GOCOVERDIR. Unlike the legacy | |
| # text -coverprofile output, covdata produces canonical, deterministic | |
| # block ranges and proper per-statement merging across packages | |
| # instrumented by -coverpkg — no dedup workaround needed. | |
| run: | | |
| mkdir -p covdata | |
| go test -cover -coverpkg=./internal/... ./internal/... -args -test.gocoverdir="$PWD/covdata" | |
| go tool covdata textfmt -i=covdata -o=cover.out | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4 | |
| with: | |
| name: code-coverage | |
| path: cover.out | |
| - name: Download artifact (main.breakdown) | |
| id: download-main-breakdown | |
| uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| branch: main | |
| workflow_conclusion: success | |
| name: main.breakdown | |
| if_no_artifact_found: warn | |
| - name: Check test coverage | |
| id: coverage | |
| uses: vladopajic/go-test-coverage/action/source@f190f667e23b4441202d0bab0f8c2e7bce8925b6 # v2 | |
| env: | |
| GOTOOLCHAIN: auto # v2.18.4 requires Go 1.26; let it auto-download | |
| with: | |
| profile: cover.out | |
| git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }} | |
| git-branch: badges | |
| breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }} | |
| diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact == 'true' && 'main.breakdown' || '' }} | |
| - name: Upload artifact (main.breakdown) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4 | |
| if: github.ref_name == 'main' | |
| with: | |
| name: main.breakdown | |
| path: main.breakdown | |
| if-no-files-found: error | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP')) | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Build x64 DLL | |
| run: | | |
| docker run --rm -v "${{ github.workspace }}:/go/work" -w /go/work x1unix/go-mingw:1.25 \ | |
| go build -buildvcs=false \ | |
| -ldflags "-X main.BuildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -X main.BuildCommit=${{ github.sha }}" \ | |
| -o dist/ocap_recorder_x64.dll -buildmode=c-shared ./cmd/ocap_recorder | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4 | |
| with: | |
| name: dll-artifacts | |
| path: dist/ocap_recorder_x64.dll | |
| code_coverage: | |
| name: "Code coverage report" | |
| if: github.event_name == 'pull_request' && !github.event.pull_request.draft | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| steps: | |
| - uses: fgrosse/go-coverage-report@cbeb2ab2e32591d690337146ba02a911cc566f3f # v1.3.0 | |
| with: | |
| coverage-artifact-name: "code-coverage" | |
| coverage-file-name: "cover.out" | |
| root-package: "github.com/OCAP2/extension/v5" |