Skip to content

Commit

Permalink
CI: test AVX512 assembly routines with QEMU
Browse files Browse the repository at this point in the history
  • Loading branch information
thedataking committed Apr 24, 2024
1 parent fdcfe65 commit adef029
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build and test on armv7 and aarch64 with QEMU
name: build and test with QEMU
on:
push:
branches:
Expand All @@ -12,29 +12,24 @@ jobs:
include:
- target: "armv7-unknown-linux-gnueabihf"
linker: "arm-linux-gnueabihf-gcc"
interpreter: "qemu-arm"
wrapper: "qemu-arm-static"
packages: "g++-arm-linux-gnueabihf libc6-dev-armhf-cross"
- target: "aarch64-unknown-linux-gnu"
linker: "aarch64-linux-gnu-gcc"
interpreter: "qemu-aarch64"
wrapper: "qemu-aarch64-static"
packages: "g++-aarch64-linux-gnu libc6-dev-arm64-cross"
- target: "x86_64-unknown-linux-gnu"
linker: "cc"
wrapper: "qemu-x86_64-static -cpu max" # enable AVX512
packages: ""
runs-on: ubuntu-latest
name: test on ${{ matrix.target }}
steps:
- name: install prerequisites
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ${{ matrix.packages }} binfmt-support qemu-user-static meson nasm
packages: ${{ matrix.packages }} qemu-user-static meson nasm
version: 1.0 # version of cache to load
# since binfmt-support was likely cached from previous run, we need to
# re-run the post installation step from that package to register
# qemu-arm, qemu-aarch64, etc. as an interpreter for the cross compiled
# binaries.
- name: register ${{ matrix.interpreter }} as interpreter
run: |
sudo update-binfmts --import
sudo update-binfmts --enable ${{ matrix.interpreter }}
update-binfmts --display
- name: git checkout
uses: actions/checkout@v4
with:
Expand All @@ -58,7 +53,8 @@ jobs:
run: |
.github/workflows/test.sh -t 2 \
-r target/${{ matrix.target }}/release/dav1d \
-s target/${{ matrix.target }}/release/seek_stress
-s target/${{ matrix.target }}/release/seek_stress \
-w "${{ matrix.wrapper }}"
- name: upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ rust_test_path=
seek_stress_test_rust_path=
debug_opt=
frame_delay=
while getopts t:r:d:s:f: flag
wrapper=
while getopts t:r:d:s:f:w: flag
do
case "${flag}" in
t) timeout_multiplier=${OPTARG};;
r) rust_test_path="-Dtest_rust_path=${OPTARG}";;
s) seek_stress_test_rust_path="-Dseek_stress_test_rust_path=${OPTARG}";;
d) debug_opt="-Ddebug=true";;
f) frame_delay=${OPTARG};;
w) wrapper=${OPTARG};;
esac
done

Expand Down Expand Up @@ -67,4 +69,10 @@ if [[ -n $frame_delay ]]; then
test_args+=(--test-args "--threads 2 --framedelay $frame_delay")
fi

if [[ -n $wrapper ]]; then
# This lets us run tests under QEMU to test instructions not supported
# by the current host or binaries compiled for another architecture
test_args+=(--wrapper "$wrapper")
fi

cd build && meson test "${test_args[@]}"

0 comments on commit adef029

Please sign in to comment.