Skip to content

Commit

Permalink
Make artifact names unique across self-test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shore committed May 7, 2024
1 parent 6026ec1 commit 55e77e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/self-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
# with different sets of inputs, and assert that the action succeeds or
# fails correctly.

# Each test uses a distinct product_name that must account for both the job name
# and the variants introduced via job matrix in order to avoid duplicate artifact
# names (which cannot be uploaded as of actions/upload-artifact@v4.

# A single reproducible go binary.
ok-single-file:
runs-on: ${{ inputs.runner }}
Expand All @@ -31,6 +35,7 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files are identical and there are no other files in the zip"
Expand All @@ -52,6 +57,7 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files are identical and so are two other files in the zip"
Expand Down Expand Up @@ -84,6 +90,7 @@ jobs:
- uses: ./self-test
if: runner.os == 'macOS'
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
reproducible: ${{ matrix.reproducible }}
Expand All @@ -107,6 +114,7 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files reproduce but the zip files do not"
Expand All @@ -130,6 +138,7 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "neither the binary file not the zip file reproduce"
Expand All @@ -152,6 +161,7 @@ jobs:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary file is not written to the correct path"
Expand Down
2 changes: 1 addition & 1 deletion self-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
id: build
uses: ./ # The action at the root of this repo.
with:
product_name: ${{ inputs.product_name }}_${{ github.job }}
product_name: ${{ inputs.product_name }}
product_version: ${{ inputs.product_version }}
go_version: ${{ inputs.go_version }}
os: ${{ inputs.os }}
Expand Down

0 comments on commit 55e77e6

Please sign in to comment.