Repository navigation
64 lines (60 loc) · 2.53 KB
/
Copy pathruntime-image.yml
File metadata and controls
64 lines (60 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Runtime Image
on:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: runtime-image-${{ github.ref }}
cancel-in-progress: false
jobs:
validate:
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- name: Checkout candidate
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Resolve candidate identity
id: source
run: echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- name: Prepare private evidence directory
run: mkdir -p .artifacts/runtime
- name: Build Linux amd64 candidate locally
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: scripts/Dockerfile.runtime
platforms: linux/amd64
load: true
push: false
tags: diffex-runtime:candidate
build-args: SOURCE_COMMIT=${{ steps.source.outputs.commit }}
cache-from: type=gha,scope=diffex-runtime
cache-to: type=gha,mode=max,scope=diffex-runtime
# Docker's local exporter cannot retain attestations.
# GHCR publication requires a separate reviewed OCI attestation gate.
provenance: false
sbom: false
- name: Validate hosted process without external networking
run: |
docker run --rm --network none \
--mount "type=bind,src=$GITHUB_WORKSPACE/scripts/fixtures,dst=/acceptance,readonly" \
--entrypoint node diffex-runtime:candidate /acceptance/runtime-smoke.mjs \
> .artifacts/runtime/smoke.json
- name: Inspect every candidate image layer
run: |
docker save --output .artifacts/runtime/runtime.tar diffex-runtime:candidate
python3 scripts/check-runtime-image.py .artifacts/runtime/runtime.tar > .artifacts/runtime/payload.json
docker inspect diffex-runtime:candidate > .artifacts/runtime/image.json
sha256sum .artifacts/runtime/runtime.tar > .artifacts/runtime/SHA256SUMS
- name: Retain tested image and private evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: runtime-candidate-${{ steps.source.outputs.commit }}
path: .artifacts/runtime/
if-no-files-found: error
retention-days: 14