From adef029a4c54bbe192084946d08b3711a3f0e4b3 Mon Sep 17 00:00:00 2001 From: Per Larsen Date: Tue, 23 Apr 2024 17:42:26 -0700 Subject: [PATCH] CI: test AVX512 assembly routines with QEMU --- ...d-test-arm.yml => build-and-test-qemu.yml} | 24 ++++++++----------- .github/workflows/test.sh | 10 +++++++- 2 files changed, 19 insertions(+), 15 deletions(-) rename .github/workflows/{build-and-test-arm.yml => build-and-test-qemu.yml} (73%) diff --git a/.github/workflows/build-and-test-arm.yml b/.github/workflows/build-and-test-qemu.yml similarity index 73% rename from .github/workflows/build-and-test-arm.yml rename to .github/workflows/build-and-test-qemu.yml index 00690b6ad..f577b41bf 100644 --- a/.github/workflows/build-and-test-arm.yml +++ b/.github/workflows/build-and-test-qemu.yml @@ -1,4 +1,4 @@ -name: build and test on armv7 and aarch64 with QEMU +name: build and test with QEMU on: push: branches: @@ -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: @@ -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 diff --git a/.github/workflows/test.sh b/.github/workflows/test.sh index 7d6851e89..65748c292 100755 --- a/.github/workflows/test.sh +++ b/.github/workflows/test.sh @@ -8,7 +8,8 @@ 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};; @@ -16,6 +17,7 @@ do 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 @@ -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[@]}"