Skip to content

Commit 0898bf8

Browse files
committed
ci: test uploaded dev build
1 parent 94aa584 commit 0898bf8

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

.github/workflows/dev.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ jobs:
5252
runs-on: ubuntu-latest
5353
outputs:
5454
UPLOAD_VERSION: ${{ steps.meta.outputs.upload_version }}
55+
COMMIT_SHA: ${{ steps.meta.outputs.sha }}
5556
steps:
56-
- name: Derive image version (pr-123-HASH)
57+
- name: Derive image version
5758
id: meta
5859
run: |
5960
PR_NUMBER=${{ github.event.pull_request.number }}
60-
COMMIT_HASH=${{ github.event.pull_request.head.sha }}
61-
UPLOAD_VERSION="pr-${PR_NUMBER}-${COMMIT_HASH}"
61+
UPLOAD_VERSION="pr-${PR_NUMBER}"
6262
echo "upload_version=${UPLOAD_VERSION}" >> $GITHUB_OUTPUT
63+
SHA="${ GITHUB_SHA::8 }"
64+
echo "sha=${SHA}" >> $GITHUB_OUTPUT
6365
6466
upload:
6567
name: Upload PR image to OCI
@@ -72,3 +74,11 @@ jobs:
7274
flavor_filter: '--include-only "metal-sci_usi-amd64"'
7375
additional_semver_tag: false
7476
secrets: inherit
77+
78+
test:
79+
name: Test PR image
80+
needs: [meta, upload]
81+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.action != 'closed' }}
82+
uses: ./.github/workflows/test.yml
83+
with:
84+
image_tag: "pr-${{ github.event.pull_request.number }}-metal-sci_usi-amd64-${{ needs.set_version.outputs.VERSION }}-${{ needs.meta.outputs.COMMIT_SHA }}-amd64"

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
description: "Image tag to test (must be usi-sci)"
1515
type: string
1616
default: ""
17+
workflow_call:
18+
inputs:
19+
image_tag:
20+
description: "Image tag to test (must be usi-sci)"
21+
type: string
22+
required: true
1723

1824
jobs:
1925
test:

0 commit comments

Comments
 (0)