Skip to content

Commit fde79f1

Browse files
authored
fix(ci): align integration inputs with release candidate source (#4048)
Signed-off-by: Simon Scatton <sscatton@nvidia.com>
1 parent fe38637 commit fde79f1

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎.github/workflows/integration-test.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
required: false
1212
type: string
1313
default: ""
14+
source-sha:
15+
description: Candidate source revision; defaults to the artifact run head SHA
16+
required: false
17+
type: string
18+
default: ""
1419
category:
1520
description: Integration-test category, used for the job name and concurrency key
1621
required: true
@@ -38,6 +43,7 @@ jobs:
3843
uses: ./.github/workflows/prepare-integration-inputs.yml
3944
with:
4045
artifact-run-id: ${{ inputs['artifact-run-id'] }}
46+
source-sha: ${{ inputs['source-sha'] }}
4147

4248
integration:
4349
needs: prepare

‎.github/workflows/prepare-integration-inputs.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
required: false
1212
type: string
1313
default: ""
14+
source-sha:
15+
description: Candidate source revision; defaults to the artifact run head SHA
16+
required: false
17+
type: string
18+
default: ""
1419
deb-artifact-name:
1520
description: Debian package artifact to include in the tmachine inputs
1621
required: false
@@ -43,9 +48,12 @@ jobs:
4348
env:
4449
ARTIFACT_RUN_ID: ${{ inputs['artifact-run-id'] || github.run_id }}
4550
GH_TOKEN: ${{ github.token }}
51+
SOURCE_SHA: ${{ inputs['source-sha'] }}
4652
run: |
47-
head_sha=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${ARTIFACT_RUN_ID}" --jq .head_sha)
48-
echo "source_sha=${head_sha}" >> "$GITHUB_OUTPUT"
53+
if [ -z "${SOURCE_SHA}" ]; then
54+
SOURCE_SHA=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${ARTIFACT_RUN_ID}" --jq .head_sha)
55+
fi
56+
echo "source_sha=${SOURCE_SHA}" >> "$GITHUB_OUTPUT"
4957
5058
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5159
with:

‎.github/workflows/release-tag.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
packages: read
160160
uses: ./.github/workflows/prepare-integration-inputs.yml
161161
with:
162+
source-sha: ${{ needs.compute-versions.outputs.source_sha }}
162163
deb-artifact-name: deb-linux-amd64
163164

164165
conformance-integration:

‎CI.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ its v1alpha1 fallback, so v0.5.0 is not the overall minimum supported version.
4949
### Run only the policy advisor conformance tests
5050

5151
Manually dispatch `Integration Tests` on the candidate branch with an
52-
`artifact-run-id` from a build of the same commit. Set `category` to
53-
`policy-advisor` and `test-matrix` to:
52+
`artifact-run-id` from a build of the same commit. When a `Release Tag` run was
53+
dispatched from a different commit, also set `source-sha` to the release tag's
54+
resolved commit so runtime images and test inputs match the candidate binaries.
55+
Otherwise, `source-sha` defaults to the artifact run's head SHA. Set `category`
56+
to `policy-advisor` and `test-matrix` to:
5457

5558
```json
5659
[{"environment":"ubuntu-docker-rootful","installer":"binaries","testsuite":"policy-advisor"}]

0 commit comments

Comments
 (0)