44name : Conformance
55
66on :
7- workflow_dispatch : {}
7+ workflow_dispatch :
8+ inputs :
9+ target_arch :
10+ description : " Architecture for package artifacts"
11+ required : false
12+ default : amd64
13+ type : choice
14+ options :
15+ - amd64
16+ - arm64
817
918permissions : {}
1019
2635 - id : gate
2736 uses : ./.github/actions/pr-gate
2837
38+ target :
39+ name : Resolve target architecture
40+ needs : pr_metadata
41+ if : needs.pr_metadata.outputs.should_run == 'true'
42+ runs-on : ubuntu-latest
43+ outputs :
44+ arch : ${{ steps.target.outputs.arch }}
45+ build_runner : ${{ steps.target.outputs.build_runner }}
46+ test_runner : ${{ steps.target.outputs.test_runner }}
47+ rpm_arch : ${{ steps.target.outputs.rpm_arch }}
48+ musl_triple : ${{ steps.target.outputs.musl_triple }}
49+ gnu_triple : ${{ steps.target.outputs.gnu_triple }}
50+ musl_dev_shell : ${{ steps.target.outputs.musl_dev_shell }}
51+ gnu_dev_shell : ${{ steps.target.outputs.gnu_dev_shell }}
52+ gateway_interpreter : ${{ steps.target.outputs.gateway_interpreter }}
53+ steps :
54+ - id : target
55+ shell : bash
56+ run : |
57+ set -euo pipefail
58+ case "${{ inputs.target_arch }}" in
59+ amd64)
60+ cat >> "$GITHUB_OUTPUT" <<'EOF'
61+ arch=amd64
62+ build_runner=linux-amd64-cpu8
63+ test_runner=ubuntu-24.04
64+ rpm_arch=x86_64
65+ musl_triple=x86_64-unknown-linux-musl
66+ gnu_triple=x86_64-unknown-linux-gnu
67+ musl_dev_shell=.#devShells.x86_64-linux.musl
68+ gnu_dev_shell=.#devShells.x86_64-linux.glibc-2-28
69+ gateway_interpreter=/lib64/ld-linux-x86-64.so.2
70+ EOF
71+ ;;
72+ arm64)
73+ cat >> "$GITHUB_OUTPUT" <<'EOF'
74+ arch=arm64
75+ build_runner=linux-arm64-cpu8
76+ test_runner=ubuntu-24.04-arm
77+ rpm_arch=aarch64
78+ musl_triple=aarch64-unknown-linux-musl
79+ gnu_triple=aarch64-unknown-linux-gnu
80+ musl_dev_shell=.#devShells.aarch64-linux.musl
81+ gnu_dev_shell=.#devShells.aarch64-linux.glibc-2-28
82+ gateway_interpreter=/lib/ld-linux-aarch64.so.1
83+ EOF
84+ ;;
85+ esac
86+
2987 version :
3088 needs : pr_metadata
3189 if : needs.pr_metadata.outputs.should_run == 'true'
@@ -55,71 +113,101 @@ jobs:
55113 } >> "$GITHUB_OUTPUT"
56114
57115 build-cli :
58- needs : version
116+ needs : [ version, target]
59117 permissions :
60118 contents : read
61119 uses : ./.github/workflows/build-binaries.yml
62120 with :
63121 package : openshell-cli
64122 binary : openshell
65- triple : x86_64-unknown-linux-musl
66- runner : linux-amd64-cpu8
67- dev-shell : . #devShells.x86_64-linux.musl
123+ triple : ${{ needs.target.outputs.musl_triple }}
124+ runner : ${{ needs.target.outputs.build_runner }}
125+ dev-shell : ${{ needs.target.outputs.musl_dev_shell }}
68126 cargo-version : ${{ needs.version.outputs.cargo }}
69127 checkout-ref : ${{ github.sha }}
70128 secrets : inherit
71129
72130 build-conformance :
73- needs : version
131+ needs : [ version, target]
74132 permissions :
75133 contents : read
76134 uses : ./.github/workflows/build-binaries.yml
77135 with :
78136 package : openshell-conformance-cli
79137 binary : openshell-conformance
80- triple : x86_64-unknown-linux-musl
81- runner : linux-amd64-cpu8
82- dev-shell : . #devShells.x86_64-linux.musl
138+ triple : ${{ needs.target.outputs.musl_triple }}
139+ runner : ${{ needs.target.outputs.build_runner }}
140+ dev-shell : ${{ needs.target.outputs.musl_dev_shell }}
83141 cargo-version : ${{ needs.version.outputs.cargo }}
84142 checkout-ref : ${{ github.sha }}
85143 secrets : inherit
86144
87145 build-gateway :
88- needs : version
146+ needs : [ version, target]
89147 permissions :
90148 contents : read
91149 uses : ./.github/workflows/build-binaries.yml
92150 with :
93151 package : openshell-gateway
94152 binary : openshell-gateway
95- triple : x86_64-unknown-linux-gnu
96- runner : linux-amd64-cpu8
97- dev-shell : . #devShells.x86_64-linux.glibc-2-28
153+ triple : ${{ needs.target.outputs.gnu_triple }}
154+ runner : ${{ needs.target.outputs.build_runner }}
155+ dev-shell : ${{ needs.target.outputs.gnu_dev_shell }}
98156 cargo-version : ${{ needs.version.outputs.cargo }}
99157 image-tag : dev
100- interpreter : /lib64/ld-linux-x86-64.so.2
158+ interpreter : ${{ needs.target.outputs.gateway_interpreter }}
101159 checkout-ref : ${{ github.sha }}
102160 secrets : inherit
103161
162+ build-sandbox :
163+ needs : [version, target]
164+ permissions :
165+ contents : read
166+ uses : ./.github/workflows/build-binaries.yml
167+ with :
168+ package : openshell-sandbox
169+ binary : openshell-sandbox
170+ triple : ${{ needs.target.outputs.musl_triple }}
171+ runner : ${{ needs.target.outputs.build_runner }}
172+ dev-shell : ${{ needs.target.outputs.musl_dev_shell }}
173+ cargo-version : ${{ needs.version.outputs.cargo }}
174+ checkout-ref : ${{ github.sha }}
175+ secrets : inherit
176+
177+ build-snap :
178+ needs : [build-cli, build-gateway, build-sandbox, target]
179+ permissions :
180+ actions : read
181+ contents : read
182+ packages : read
183+ uses : ./.github/workflows/build-snap.yml
184+ with :
185+ checkout-ref : ${{ github.sha }}
186+ arch : ${{ needs.target.outputs.arch }}
187+ runner : ${{ needs.target.outputs.build_runner }}
188+ cli-artifact-name : openshell-${{ needs.target.outputs.musl_triple }}
189+ gateway-artifact-name : openshell-gateway-${{ needs.target.outputs.gnu_triple }}
190+ supervisor-artifact-name : openshell-sandbox-${{ needs.target.outputs.musl_triple }}
191+
104192 build-rpm :
105- needs : [version, build-cli, build-gateway]
193+ needs : [version, build-cli, build-gateway, target ]
106194 permissions :
107195 contents : read
108196 uses : ./.github/workflows/build-rpm.yml
109197 with :
110198 checkout-ref : ${{ github.sha }}
111- arch : x86_64
112- runner : linux-amd64-cpu8
113- cli-target : x86_64-unknown-linux-musl
114- gateway-target : x86_64-unknown-linux-gnu
199+ arch : ${{ needs.target.outputs.rpm_arch }}
200+ runner : ${{ needs.target.outputs.build_runner }}
201+ cli-target : ${{ needs.target.outputs.musl_triple }}
202+ gateway-target : ${{ needs.target.outputs.gnu_triple }}
115203 cargo-version : ${{ needs.version.outputs.cargo }}
116204 rpm-version : ${{ needs.version.outputs.rpm_version }}
117205 rpm-release : ${{ needs.version.outputs.rpm_release }}
118206
119207 fedora :
120208 name : Fedora with Rootless Podman
121- needs : [build-conformance, build-rpm]
122- runs-on : ubuntu-24.04
209+ needs : [build-conformance, build-rpm, target ]
210+ runs-on : ${{ needs.target.outputs.test_runner }}
123211 timeout-minutes : 45
124212 permissions :
125213 actions : read
@@ -145,13 +233,13 @@ jobs:
145233 - name : Download RPM artifacts
146234 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
147235 with :
148- name : rpm-linux-x86_64
236+ name : rpm-linux-${{ needs.target.outputs.rpm_arch }}
149237 path : rpm-input
150238
151239 - name : Download conformance CLI
152240 uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
153241 with :
154- name : openshell-conformance-x86_64-unknown-linux-musl
242+ name : openshell-conformance-${{ needs.target.outputs.musl_triple }}
155243 path : conformance-input
156244
157245 - name : Install RPMs and check status
0 commit comments