Skip to content

Commit 1d6de29

Browse files
committed
ci(conformance): consume candidate artifacts in tmachine
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 23574ea commit 1d6de29

1 file changed

Lines changed: 152 additions & 5 deletions

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 152 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,133 @@ jobs:
2626
- id: gate
2727
uses: ./.github/actions/pr-gate
2828

29+
version:
30+
needs: pr_metadata
31+
if: needs.pr_metadata.outputs.should_run == 'true'
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 5
34+
permissions:
35+
contents: read
36+
outputs:
37+
cargo: ${{ steps.version.outputs.cargo }}
38+
steps:
39+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Compute version
44+
id: version
45+
run: echo "cargo=$(python3 tasks/scripts/release.py get-version --cargo)" >> "$GITHUB_OUTPUT"
46+
47+
build-cli:
48+
needs: version
49+
permissions:
50+
contents: read
51+
uses: ./.github/workflows/build-binaries.yml
52+
with:
53+
package: openshell-cli
54+
binary: openshell
55+
triple: x86_64-unknown-linux-musl
56+
runner: linux-amd64-cpu8
57+
cargo-version: ${{ needs.version.outputs.cargo }}
58+
checkout-ref: ${{ github.sha }}
59+
secrets: inherit
60+
61+
build-gateway:
62+
needs: version
63+
permissions:
64+
contents: read
65+
uses: ./.github/workflows/build-binaries.yml
66+
with:
67+
package: openshell-gateway
68+
binary: openshell-gateway
69+
triple: x86_64-unknown-linux-gnu
70+
runner: linux-amd64-cpu8
71+
cargo-version: ${{ needs.version.outputs.cargo }}
72+
image-tag: ${{ github.sha }}
73+
checkout-ref: ${{ github.sha }}
74+
secrets: inherit
75+
76+
build-runtimes:
77+
needs: version
78+
permissions:
79+
contents: read
80+
uses: ./.github/workflows/build-runtime-binaries.yml
81+
with:
82+
cargo-version: ${{ needs.version.outputs.cargo }}
83+
image-tag: ${{ github.sha }}
84+
checkout-ref: ${{ github.sha }}
85+
secrets: inherit
86+
87+
build-sandbox-image:
88+
needs: build-runtimes
89+
permissions:
90+
contents: read
91+
packages: write
92+
uses: ./.github/workflows/docker-build.yml
93+
with:
94+
component: sandbox
95+
binary: openshell-sandbox
96+
target-suffix: unknown-linux-musl
97+
image-tag: ${{ github.sha }}
98+
checkout-ref: ${{ github.sha }}
99+
secrets: inherit
100+
101+
build-supervisor-image:
102+
needs: build-runtimes
103+
permissions:
104+
contents: read
105+
packages: write
106+
uses: ./.github/workflows/docker-build.yml
107+
with:
108+
component: supervisor
109+
binary: openshell-supervisor
110+
target-suffix: unknown-linux-gnu
111+
image-tag: ${{ github.sha }}
112+
checkout-ref: ${{ github.sha }}
113+
secrets: inherit
114+
115+
build-conformance-archive:
116+
needs: version
117+
runs-on: linux-amd64-cpu8
118+
timeout-minutes: 30
119+
permissions:
120+
contents: read
121+
steps:
122+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
123+
with:
124+
ref: ${{ github.sha }}
125+
126+
- uses: ./.github/actions/setup-nix
127+
128+
- name: Build conformance nextest archive
129+
run: nix run .#build-artifacts-test-archives
130+
131+
- name: Upload conformance nextest archive
132+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
133+
with:
134+
name: openshell-conformance-tests-x86_64-unknown-linux-musl
135+
path: artifacts/test-archives/x86_64-unknown-linux-musl/openshell-conformance-tests.tar
136+
compression-level: 0
137+
retention-days: 5
138+
if-no-files-found: error
139+
29140
fedora:
30141
name: Fedora with Rootless Podman
31-
needs: pr_metadata
142+
needs:
143+
- pr_metadata
144+
- build-cli
145+
- build-gateway
146+
- build-sandbox-image
147+
- build-supervisor-image
148+
- build-conformance-archive
32149
if: needs.pr_metadata.outputs.should_run == 'true'
33150
runs-on: ubuntu-24.04
34151
timeout-minutes: 90
35152
permissions:
36153
actions: read
37154
contents: read
155+
packages: read
38156
steps:
39157
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
40158
with:
@@ -53,13 +171,42 @@ jobs:
53171
54172
- uses: ./.github/actions/setup-nix
55173

56-
- name: Build t-machine test artifacts
174+
- name: Download candidate CLI
175+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
176+
with:
177+
name: openshell-x86_64-unknown-linux-musl
178+
path: candidate/cli
179+
180+
- name: Download candidate gateway
181+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
182+
with:
183+
name: openshell-gateway-x86_64-unknown-linux-gnu
184+
path: candidate/gateway
185+
186+
- name: Download conformance nextest archive
187+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
188+
with:
189+
name: openshell-conformance-tests-x86_64-unknown-linux-musl
190+
path: artifacts/test-archives/x86_64-unknown-linux-musl
191+
192+
- name: Stage candidate artifacts for t-machine
57193
shell: bash
194+
env:
195+
IMAGE_TAG: ${{ github.sha }}
58196
run: |
59197
set -euo pipefail
60-
nix run .#build-artifacts-binaries
61-
nix run .#build-artifacts-test-archives
62-
nix run .#build-artifacts-images
198+
install -Dm0755 candidate/cli/openshell \
199+
target/x86_64-unknown-linux-musl/debug/openshell
200+
install -Dm0755 candidate/gateway/openshell-gateway \
201+
target/x86_64-unknown-linux-gnu/debug/openshell-gateway
202+
203+
for component in sandbox supervisor; do
204+
source="ghcr.io/nvidia/openshell/${component}:${IMAGE_TAG}"
205+
target="docker.io/openshell/${component}:tmachine"
206+
docker pull "$source"
207+
docker image tag "$source" "$target"
208+
docker save --output "artifacts/images/openshell-${component}-tmachine.tar" "$target"
209+
done
63210
64211
- name: Run t-machine conformance archive
65212
run: nix run .#tmachine -- test fedora-podman-rootless smoke

0 commit comments

Comments
 (0)