Skip to content

Commit

Permalink
try using variables
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Jun 3, 2024
1 parent cf69ba8 commit 569ed56
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,24 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Create test variables
run:
URL=$(jq -r 'keys_unsorted[0] as $k | .[$k].linux.amd64.url' src/lib/data/releases.json)
CHECKSUM=$(jq -r 'keys_unsorted[0] as $k | .[$k].linux.amd64.checksum' src/lib/data/releases.json)

- name: Setup ORAS using URL
uses: ./
with:
url: https://github.com/oras-project/oras/releases/download/v1.0.0/oras_1.0.0_linux_amd64.tar.gz
url: ${{ env.URL }}
checksum: "8533c9ea1e5a0d5eb1dfc5094c0e8ef106d15462f8a119077548f88937ed2133"

- name: Setup ORAS using URL without checksum
id: no-checksum
continue-on-error: true
uses: ./
with:
url: https://github.com/oras-project/oras/releases/download/v1.0.0/oras_1.0.0_linux_amd64.tar.gz
url: ${{ env.URL }}
- name: 'Should Fail: Setup ORAS using URL without checksum'
if: steps.no-checksum.outcome != 'failure'
run: |
Expand All @@ -87,7 +92,7 @@ jobs:
continue-on-error: true
uses: ./
with:
url: https://github.com/oras-project/oras/releases/download/v1.0.0/oras_1.0.0_linux_amd64.tar.gz
url: ${{ env.URL }}
checksum: abcedf
- name: 'Should Fail: Setup ORAS using URL and invalid checksum'
if: steps.invalid-checksum.outcome != 'failure'
Expand Down

0 comments on commit 569ed56

Please sign in to comment.