.github: save CI time

These jobs take 18 seconds of machine time and 21 seconds of setup;
consolidate them into one job to cut down on the overhead.
reviewable/pr1376/r9
Tamir Duberstein 2 days ago
parent 05250da20b
commit e5eb3058aa
No known key found for this signature in database

@ -144,21 +144,6 @@ jobs:
--workspace
build-test-aya-ebpf:
strategy:
fail-fast: false
matrix:
bpf_target_arch:
- aarch64
- arm
- loongarch64
- mips
- powerpc64
- riscv64
- s390x
- x86_64
target:
- bpfel-unknown-none
- bpfeb-unknown-none
runs-on: ubuntu-latest
steps:
@ -177,30 +162,49 @@ jobs:
- uses: taiki-e/install-action@cargo-hack
- name: Build
- name: Build & test for all BPF architectures
env:
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.bpf_target_arch }}
run: |
set -euxo pipefail
cargo +nightly hack build \
--target ${{ matrix.target }} \
-Z build-std=core \
--package aya-ebpf \
--package aya-log-ebpf \
--feature-powerset
- name: Test
env:
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.bpf_target_arch }}
RUST_BACKTRACE: full
run: |
set -euxo pipefail
cargo hack test \
--doc \
--package aya-ebpf \
--package aya-log-ebpf \
--feature-powerset
set -euo pipefail
failures=()
# NB: this hand-rolled shell script is used instead of a matrix
# because the time spent doing useful work per target is about equal
# to the overhead of setting up the job - so this saves a bunch of
# machine time.
for arch in aarch64 arm loongarch64 mips powerpc64 riscv64 s390x x86_64; do
for target in bpfeb-unknown-none bpfel-unknown-none; do
echo "::group::Build and test for $arch / $target"
if ! (
export CARGO_CFG_BPF_TARGET_ARCH="$arch"
cargo +nightly hack build \
--target "$target" \
-Z build-std=core \
--package aya-ebpf \
--package aya-log-ebpf \
--feature-powerset
cargo hack test \
--doc \
--package aya-ebpf \
--package aya-log-ebpf \
--feature-powerset
); then
echo "FAILED: $arch / $target"
failures+=("$arch/$target")
fi
echo "::endgroup::"
done
done
if ((${#failures[@]})); then
echo "::error::Some builds/tests failed:"
printf ' %s\n' "${failures[@]}"
exit 1
fi
run-integration-test:
strategy:
fail-fast: false

Loading…
Cancel
Save