Skip to content

Commit 2dc3b3d

Browse files
committed
[poc_linux_compile] Add Linux x86 as a matrice
1 parent 4a9c1be commit 2dc3b3d

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/poc-agent-build.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
poc_windows_x86_64_compile:
11-
name: poc_windows_x86_64_compile
1211
runs-on: windows-latest
1312

1413
steps:
@@ -74,7 +73,6 @@ jobs:
7473

7574

7675
poc_windows_arm_64_compile:
77-
name: poc_windows_arm_64_compile
7876
runs-on: windows-11-arm
7977

8078
steps:
@@ -139,9 +137,11 @@ jobs:
139137
Invoke-Expression '& "$env:USERPROFILE\.cargo\bin\cargo" test --release'
140138
shell: powershell
141139

142-
poc_linux_arm_64_compile:
143-
name: poc_linux_arm_64_compile
144-
runs-on: ubuntu-24.04-arm
140+
poc_linux_compile:
141+
strategy:
142+
matrix:
143+
runner-type: [ ubuntu-24.04, ubuntu-24.04-arm ]
144+
runs-on: ${{ matrix.runner-type }}
145145

146146
steps:
147147
- name: Checkout repository
@@ -156,8 +156,13 @@ jobs:
156156
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
157157

158158
- name: Add ARM Target
159+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04-arm'
159160
run: . "$HOME/.cargo/env"; rustup target add aarch64-unknown-linux-musl
160161

162+
- name: Add x86 Target
163+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04'
164+
run: . "$HOME/.cargo/env"; rustup target add x86_64-unknown-linux-musl
165+
161166
- name: Install Quality Tools
162167
run: |
163168
. "$HOME/.cargo/env"
@@ -173,15 +178,25 @@ jobs:
173178
cargo fmt -- --check
174179
cargo audit
175180
176-
- name: Build ARM Target
181+
- name: Cargo build ARM Target
182+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04-arm'
177183
run: . "$HOME/.cargo/env"; cargo build --target=aarch64-unknown-linux-musl --release
178184

179-
- name: Test ARM Target
185+
- name: Cargo build x86 Target
186+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04'
187+
run: . "$HOME/.cargo/env"; cargo build --target=x86_64-unknown-linux-musl --release
188+
189+
- name: Cargo test
180190
run: . "$HOME/.cargo/env"; cargo test --release
181191

182-
- name: Strip Binary
192+
- name: Strip Binary ARM Target
193+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04-arm'
183194
run: strip ./target/aarch64-unknown-linux-musl/release/openbas-agent
184195

196+
- name: Strip Binary x86 Target
197+
if: ${{ matrix.runner-type }} == 'ubuntu-24.04'
198+
run: strip ./target/x86_64-unknown-linux-musl/release/openbas-agent
199+
185200

186201

187202
poc_macos_matrix_compile:

0 commit comments

Comments
 (0)