Skip to content

Commit 42231d8

Browse files
committed
ci: build external driver test artifacts
Refs #1683 Signed-off-by: Simon Scatton <[email protected]>
1 parent b053940 commit 42231d8

8 files changed

Lines changed: 97 additions & 19 deletions

File tree

‎.github/actions/build-docker-image/action.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ runs:
4343

4444
- name: Stage ${{ inputs.binary }}
4545
shell: bash
46-
run: |
47-
install -d deploy/docker/.build/prebuilt-binaries/${{ inputs.arch }}
48-
tar -xzf artifact/${{ inputs.binary }}-${{ inputs.triple }}.tar.gz -C artifact
49-
install -m 0755 artifact/${{ inputs.binary }} deploy/docker/.build/prebuilt-binaries/${{ inputs.arch }}/${{ inputs.binary }}
46+
run: install -Dm0755 artifact/${{ inputs.binary }} deploy/docker/.build/prebuilt-binaries/${{ inputs.arch }}/${{ inputs.binary }}
5047

5148
- name: Build ${{ inputs.component }} image
5249
shell: bash

‎.github/actions/build-rust-binary/action.yml‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ inputs:
1717
cargo-version:
1818
description: Cargo package version embedded in the binary
1919
required: true
20+
artifact-name:
21+
description: GitHub artifact name
22+
required: false
23+
default: ""
24+
extra-cargo-flags:
25+
description: Additional flags passed to cargo build
26+
required: false
27+
default: ""
2028
interpreter:
2129
description: ELF interpreter for a dynamically linked Linux binary
2230
required: false
@@ -40,7 +48,7 @@ runs:
4048

4149
- name: Build ${{ inputs.binary }}
4250
shell: nix develop ${{ inputs.dev-shell }} -c bash -euo pipefail {0}
43-
run: GIT_DIR=/nonexistent cargo auditable build --release --bin "${{ inputs.binary }}"
51+
run: GIT_DIR=/nonexistent cargo auditable build --release --bin "${{ inputs.binary }}" ${{ inputs.extra-cargo-flags }}
4452

4553
- name: Verify ${{ inputs.binary }}
4654
shell: nix develop ${{ inputs.dev-shell }} -c bash -euo pipefail {0}
@@ -67,16 +75,11 @@ runs:
6775
# Reject symbols introduced after glibc 2.28.
6876
tasks/scripts/verify-glibc-symbols.sh 2.28 "$binary"
6977
70-
- name: Package ${{ inputs.binary }}
71-
shell: nix develop ${{ inputs.dev-shell }} -c bash -euo pipefail {0}
72-
run: |
73-
install -Dm0755 target/release/${{ inputs.binary }} artifacts/${{ inputs.binary }}
74-
tar -czf artifacts/${{ inputs.binary }}-${{ inputs.triple }}.tar.gz -C artifacts ${{ inputs.binary }}
75-
7678
- name: Upload ${{ inputs.binary }}
7779
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
7880
with:
79-
name: ${{ inputs.binary }}-${{ inputs.triple }}
80-
path: artifacts/*.tar.gz
81+
name: ${{ inputs.artifact-name || format('{0}-{1}', inputs.binary, inputs.triple) }}
82+
path: target/release/${{ inputs.binary }}
83+
compression-level: 0
8184
retention-days: 5
8285
if-no-files-found: error

‎.github/actions/setup-e2e-cli/action.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ runs:
1313
- name: Configure prebuilt CLI
1414
shell: bash
1515
run: |
16-
tar -xzf "$GITHUB_WORKSPACE"/.e2e/prebuilt-cli/*.tar.gz -C "$GITHUB_WORKSPACE/.e2e/prebuilt-cli"
1716
cli="$GITHUB_WORKSPACE/.e2e/prebuilt-cli/openshell"
1817
chmod +x "$cli"
1918
"$cli" --version

‎.github/actions/setup-e2e-gateway/action.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ runs:
1313
- name: Configure prebuilt gateway
1414
shell: bash
1515
run: |
16-
tar -xzf "$GITHUB_WORKSPACE"/.e2e/prebuilt-gateway/*.tar.gz -C "$GITHUB_WORKSPACE/.e2e/prebuilt-gateway"
1716
gateway="$GITHUB_WORKSPACE/.e2e/prebuilt-gateway/openshell-gateway"
1817
chmod +x "$gateway"
1918
"$gateway" --version

‎.github/actions/setup-e2e-vm-driver/action.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ runs:
1313
- name: Configure prebuilt VM driver
1414
shell: bash
1515
run: |
16-
tar -xzf "$GITHUB_WORKSPACE"/.e2e/prebuilt-vm-driver/*.tar.gz -C "$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver"
1716
driver="$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver/openshell-driver-vm"
1817
chmod +x "$driver"
1918
"$driver" --version

‎.github/workflows/branch-e2e.yml‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,79 @@ jobs:
171171
interpreter: ${{ matrix.interpreter }}
172172
secrets: inherit
173173

174+
build-gateway-plain:
175+
needs: [pr_metadata, version]
176+
if: needs.pr_metadata.outputs.run_core_e2e == 'true'
177+
permissions:
178+
contents: read
179+
strategy:
180+
matrix:
181+
include:
182+
- triple: x86_64-unknown-linux-gnu
183+
runner: linux-amd64-cpu8
184+
dev_shell: .#devShells.x86_64-linux.glibc-2-28
185+
interpreter: /lib64/ld-linux-x86-64.so.2
186+
- triple: aarch64-unknown-linux-gnu
187+
runner: linux-arm64-cpu8
188+
dev_shell: .#devShells.aarch64-linux.glibc-2-28
189+
interpreter: /lib/ld-linux-aarch64.so.1
190+
uses: ./.github/workflows/build-binaries.yml
191+
with:
192+
binary: openshell-gateway
193+
artifact-name: openshell-gateway-plain-${{ matrix.triple }}
194+
triple: ${{ matrix.triple }}
195+
runner: ${{ matrix.runner }}
196+
dev-shell: ${{ matrix.dev_shell }}
197+
cargo-version: ${{ needs.version.outputs.cargo }}
198+
extra-cargo-flags: --no-default-features
199+
interpreter: ${{ matrix.interpreter }}
200+
secrets: inherit
201+
202+
build-driver-docker:
203+
needs: [pr_metadata, version]
204+
if: needs.pr_metadata.outputs.run_core_e2e == 'true'
205+
permissions:
206+
contents: read
207+
uses: ./.github/workflows/build-binaries.yml
208+
with:
209+
binary: openshell-driver-docker
210+
triple: aarch64-unknown-linux-gnu
211+
runner: linux-arm64-cpu8
212+
dev-shell: .#devShells.aarch64-linux.glibc-2-28
213+
cargo-version: ${{ needs.version.outputs.cargo }}
214+
interpreter: /lib/ld-linux-aarch64.so.1
215+
secrets: inherit
216+
217+
build-driver-podman:
218+
needs: [pr_metadata, version]
219+
if: needs.pr_metadata.outputs.run_core_e2e == 'true'
220+
permissions:
221+
contents: read
222+
uses: ./.github/workflows/build-binaries.yml
223+
with:
224+
binary: openshell-driver-podman
225+
triple: x86_64-unknown-linux-gnu
226+
runner: linux-amd64-cpu8
227+
dev-shell: .#devShells.x86_64-linux.glibc-2-28
228+
cargo-version: ${{ needs.version.outputs.cargo }}
229+
interpreter: /lib64/ld-linux-x86-64.so.2
230+
secrets: inherit
231+
232+
build-driver-kubernetes:
233+
needs: [pr_metadata, version]
234+
if: needs.pr_metadata.outputs.run_core_e2e == 'true'
235+
permissions:
236+
contents: read
237+
uses: ./.github/workflows/build-binaries.yml
238+
with:
239+
binary: openshell-driver-kubernetes
240+
triple: x86_64-unknown-linux-gnu
241+
runner: linux-amd64-cpu8
242+
dev-shell: .#devShells.x86_64-linux.glibc-2-28
243+
cargo-version: ${{ needs.version.outputs.cargo }}
244+
interpreter: /lib64/ld-linux-x86-64.so.2
245+
secrets: inherit
246+
174247
build-vm-driver:
175248
needs: [pr_metadata, version, build-sandbox]
176249
if: needs.pr_metadata.outputs.run_core_e2e == 'true'

‎.github/workflows/build-binaries.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ on:
2121
cargo-version:
2222
required: true
2323
type: string
24+
artifact-name:
25+
required: false
26+
type: string
27+
default: ""
28+
extra-cargo-flags:
29+
required: false
30+
type: string
31+
default: ""
2432
interpreter:
2533
required: false
2634
type: string
@@ -56,4 +64,6 @@ jobs:
5664
triple: ${{ inputs.triple }}
5765
dev-shell: ${{ inputs['dev-shell'] }}
5866
cargo-version: ${{ inputs['cargo-version'] }}
67+
artifact-name: ${{ inputs['artifact-name'] }}
68+
extra-cargo-flags: ${{ inputs['extra-cargo-flags'] }}
5969
interpreter: ${{ inputs.interpreter }}

‎.github/workflows/build-vm-driver.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ jobs:
8282
zstd -19 -T0 result/umoci -o target/vm-runtime-compressed/umoci.zst
8383
8484
- name: Add openshell-sandbox to VM runtime
85-
run: |
86-
tar -xzf sandbox/openshell-sandbox-${{ matrix.arch }}-unknown-linux-musl.tar.gz -C sandbox
87-
zstd -19 -T0 sandbox/openshell-sandbox -o target/vm-runtime-compressed/openshell-sandbox.zst
85+
run: zstd -19 -T0 sandbox/openshell-sandbox -o target/vm-runtime-compressed/openshell-sandbox.zst
8886

8987
- name: Build openshell-driver-vm
9088
uses: ./.github/actions/build-rust-binary

0 commit comments

Comments
 (0)