Skip to content

Commit 2798674

Browse files
committed
Run test-users.yml across multiple architectures.
1 parent f657443 commit 2798674

File tree

2 files changed

+574
-109
lines changed

2 files changed

+574
-109
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -273,48 +273,22 @@ jobs:
273273
- uses: ./.github/actions/install-rust
274274
with:
275275
toolchain: ${{ matrix.rust }}
276+
- uses: ./.github/workflows/cross.yml
277+
with:
278+
os: ${{ matrix.os }
279+
target: ${{ matrix.target }}
280+
libc_package: ${{ matrix.libc_package }}
281+
gcc_package: ${{ matrix.gcc_package }}
282+
gcc: ${{ matrix.gcc }}
283+
qemu: ${{ matrix.qemu }}
284+
qemu_target: ${{ matrix.qemu_target }}
276285

277286
- name: Configure Cargo target
278287
run: |
279288
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
280289
rustup target add ${{ matrix.target }}
281290
if: matrix.target != ''
282291

283-
- name: Install cross-compilation tools
284-
run: |
285-
set -ex
286-
sudo apt-get update
287-
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build
288-
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
289-
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV
290-
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest'
291-
292-
- name: Install cross-compilation libraries
293-
run: |
294-
set -ex
295-
sudo apt-get update
296-
sudo apt-get install -y ${{ matrix.libc_package }}
297-
if: matrix.libc_package != '' && matrix.os == 'ubuntu-latest'
298-
299-
- name: Install qemu
300-
run: |
301-
set -ex
302-
# Download and build qemu from source since the most recent release is
303-
# way faster at arm emulation than the current version github actions'
304-
# ubuntu image uses. Disable as much as we can to get it to build
305-
# quickly.
306-
cd
307-
curl https://download.qemu.org/qemu-6.1.0.tar.xz | tar xJf -
308-
cd qemu-6.1.0
309-
./configure --target-list=${{ matrix.qemu_target }} --prefix=$HOME/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
310-
make -j$(nproc) install
311-
312-
# Configure Cargo for cross compilation and tell it how it can run
313-
# cross executables
314-
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
315-
echo CARGO_TARGET_${upcase}_RUNNER=$HOME/qemu/bin/${{ matrix.qemu }} >> $GITHUB_ENV
316-
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
317-
318292
- run: |
319293
# Run the tests, and check the prebuilt release libraries.
320294
cargo test --verbose --features=all-impls,procfs,cc --release --workspace -- --nocapture
@@ -391,48 +365,22 @@ jobs:
391365
- uses: ./.github/actions/install-rust
392366
with:
393367
toolchain: ${{ matrix.rust }}
368+
- uses: ./.github/workflows/cross.yml
369+
with:
370+
os: ${{ matrix.os }
371+
target: ${{ matrix.target }}
372+
libc_package: ${{ matrix.libc_package }}
373+
gcc_package: ${{ matrix.gcc_package }}
374+
gcc: ${{ matrix.gcc }}
375+
qemu: ${{ matrix.qemu }}
376+
qemu_target: ${{ matrix.qemu_target }}
394377

395378
- name: Configure Cargo target
396379
run: |
397380
echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV
398381
rustup target add ${{ matrix.target }}
399382
if: matrix.target != ''
400383

401-
- name: Install cross-compilation tools
402-
run: |
403-
set -ex
404-
sudo apt-get update
405-
sudo apt-get install -y ${{ matrix.gcc_package }} ninja-build
406-
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
407-
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV
408-
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest'
409-
410-
- name: Install cross-compilation libraries
411-
run: |
412-
set -ex
413-
sudo apt-get update
414-
sudo apt-get install -y ${{ matrix.libc_package }}
415-
if: matrix.libc_package != '' && matrix.os == 'ubuntu-latest'
416-
417-
- name: Install qemu
418-
run: |
419-
set -ex
420-
# Download and build qemu from source since the most recent release is
421-
# way faster at arm emulation than the current version github actions'
422-
# ubuntu image uses. Disable as much as we can to get it to build
423-
# quickly.
424-
cd
425-
curl https://download.qemu.org/qemu-6.1.0.tar.xz | tar xJf -
426-
cd qemu-6.1.0
427-
./configure --target-list=${{ matrix.qemu_target }} --prefix=$HOME/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
428-
make -j$(nproc) install
429-
430-
# Configure Cargo for cross compilation and tell it how it can run
431-
# cross executables
432-
upcase=$(echo ${{ matrix.target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
433-
echo CARGO_TARGET_${upcase}_RUNNER=$HOME/qemu/bin/${{ matrix.qemu }} >> $GITHUB_ENV
434-
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
435-
436384
- run: |
437385
cargo test --verbose --features=all-impls,procfs --release --workspace -- --nocapture
438386
env:

0 commit comments

Comments
 (0)