Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/post-testing-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,21 @@ jobs:
github.event.workflow_run.head_branch == 'testing'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
actions: read
steps:
- name: Checkout
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
# workflow_run has no ref: default; without this, checkout resolves
# the default branch instead of the commit that produced the images
# being promoted, so the flavor count and the digests being
# promoted could come from two different commits.
ref: ${{ github.event.workflow_run.head_sha }}
- name: Resolve the expected image count
id: flavors
run: echo "count=$(python3 scripts/flavors.py count)" >> "$GITHUB_OUTPUT"
- name: Download all flavor digests
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -27,6 +39,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
EXPECTED: ${{ steps.flavors.outputs.count }}
run: |
set -euo pipefail
echo "$GH_TOKEN" | skopeo login ghcr.io --username "${{ github.actor }}" --password-stdin
Expand All @@ -36,4 +49,4 @@ jobs:
skopeo copy --all "docker://${REGISTRY}/${name}@${digest}" "docker://${REGISTRY}/${name}:testing"
count=$((count + 1))
done < <(find /tmp/digests -name '*.txt' -exec cat {} +)
test "$count" -eq 4
test "$count" -eq "$EXPECTED"
2 changes: 2 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ check:
<(grep -m1 '^ARG BASE_IMAGE=' Containerfile.kernel)
python3 -m py_compile scripts/flavors.py
python3 scripts/flavors.py list >/dev/null
! grep -nE 'count" -eq [0-9]' .github/workflows/post-testing-e2e.yml
grep -q 'flavors.py count' .github/workflows/post-testing-e2e.yml
pip install --quiet pyyaml 2>/dev/null || true
python3 scripts/check_workflow_outputs.py
pip install --quiet jsonschema 2>/dev/null || true
Expand Down
3 changes: 3 additions & 0 deletions scripts/flavors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
next to the list rather than in a commit message.

flavors.py list ["main"]
flavors.py count 1
flavors.py images [{"image": "utah"}, ...] promote
flavors.py releases [{"image": "utah", "source_tag": ...}, ...] release
flavors.py needs-kernel true / false
Expand All @@ -37,6 +38,8 @@
what = sys.argv[1] if len(sys.argv) > 1 else "list"
if what == "list":
print(json.dumps(flavors))
elif what == "count":
print(len(flavors))
elif what == "images":
print(json.dumps([{"image": IMAGE[f]} for f in flavors]))
elif what == "releases":
Expand Down