Skip to content

Commit

Permalink
ci: fix unit test artifact name collisions [v8] (#540)
Browse files Browse the repository at this point in the history
In a previous PR, I had refactored the go-setup step out of the unit
tests.

Unfortunately, this had the side-effect of the unit test action no
longer knowing what Go version it was using (since it used to be passed
in as a parameter.) This meant that when run in a matrix build, the test
result uploads would clash and fail to upload.

The fix is to check the current Go version using `go version` inside the
action.
  • Loading branch information
cwaldren-ld authored Feb 6, 2024
1 parent 8c02831 commit 2d46bbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions .github/actions/unit-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Unit Tests
description: "Runs Relay's unit tests + linters and optionally gathers coverage."
inputs:
go-version:
description: 'Go version to use for build & test.'
required: true
lint:
description: 'Whether to run linters.'
required: false
Expand All @@ -16,6 +13,11 @@ inputs:
runs:
using: composite
steps:
- name: Get Go version
id: go-version
shell: bash
run: |
echo "version=$(go version | awk '{print $3}')" >> $GITHUB_OUTPUT
- name: Lint
if: inputs.lint == 'true'
shell: bash
Expand Down Expand Up @@ -43,12 +45,12 @@ runs:
if: steps.process-test.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: Test-result-go${{ inputs.go-version }}
name: Test-result-${{ steps.go-version.outputs.version }}
path: junit_report.xml

- name: Upload coverage results
if: steps.test-coverage.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: Coverage-result-go${{ inputs.go-version }}
name: Coverage-result-${{ steps.go-version.outputs.version }}
path: build/coverage*
1 change: 0 additions & 1 deletion .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
- name: Publish Package
uses: ./.github/actions/publish
with:
go-version: ${{ needs.go-versions.outputs.latest }}
token: ${{ secrets.GITHUB_TOKEN }}
dry-run: ${{ inputs.dry_run }}
tag: ${{ inputs.tag }}

0 comments on commit 2d46bbc

Please sign in to comment.