diff --git a/.github/workflows/build-and-test-aarch64-darwin.yml b/.github/workflows/build-and-test-aarch64-darwin.yml new file mode 100644 index 000000000..8aaa5fcb3 --- /dev/null +++ b/.github/workflows/build-and-test-aarch64-darwin.yml @@ -0,0 +1,41 @@ +name: build and test on aarch64 +on: [push, pull_request] +jobs: + test-on-macos-aarch64: + runs-on: macos-14 + name: test on macos-14-aarch64 + steps: + - name: install prerequisites + run: | + rustup target add armv7-unknown-linux-gnueabihf + brew tap messense/macos-cross-toolchains + brew install \ + armv7-unknown-linux-gnueabihf \ + meson \ + docker + source "$HOME/.cargo/env" + - name: git checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: cache rust dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: arm-darwin-cargo-and-target-${{ hashFiles('**/Cargo.lock') }} + - name: cargo build for aarch64-apple-darwin + run: cargo build --release + - run: .github/workflows/test.sh -r ./target/release/dav1d -s ./target/release/seek_stress + - name: upload build artifacts + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v3 + with: + name: meson-test-logs + path: | + ${{ github.workspace }}/build/meson-logs/testlog.txt + diff --git a/.github/workflows/build-and-test-aarch64.yml b/.github/workflows/build-and-test-aarch64.yml index 2d00dc896..a9facf011 100644 --- a/.github/workflows/build-and-test-aarch64.yml +++ b/.github/workflows/build-and-test-aarch64.yml @@ -1,5 +1,9 @@ name: build and test on aarch64 with QEMU -on: [push, pull_request] +on: + # * is a special character in YAML so we quote lines containing it + push: + branches: + - '**qemu**' # Run when pushing branches that have qemu in the name jobs: test-on-qemu-linux-aarch64: runs-on: ubuntu-latest diff --git a/.github/workflows/build-and-test-arm7.yml b/.github/workflows/build-and-test-arm7.yml index 3ad636792..0fe4b5b77 100644 --- a/.github/workflows/build-and-test-arm7.yml +++ b/.github/workflows/build-and-test-arm7.yml @@ -8,16 +8,12 @@ jobs: - name: install prerequisites uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: g++-arm-linux-gnueabihf libc6-dev-armhf-cross + packages: g++-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-system-arm meson version: 1.0 # version of cache to load - name: git checkout uses: actions/checkout@v3 with: fetch-depth: 1 - - name: set up qemu - uses: docker/setup-qemu-action@v2 - with: - platforms: arm - name: cache rust dependencies uses: actions/cache@v3 with: @@ -28,30 +24,16 @@ jobs: ~/.cargo/git/db/ target/ key: arm7-unknown-linux-gnu-cargo-and-target-${{ hashFiles('**/Cargo.lock') }} - # - name: cache dav1d object files - # uses: actions/cache@v3 - # with: - # path: build/ - # key: aarch64-unknown-linux-gnu-c-object-files-${{ hashFiles('**/meson.build', '**/*.c', '**/*.h') }} - name: cargo build for armv7-unknown-linux-gnueabihf run: | rustup target add armv7-unknown-linux-gnueabihf - cargo build --release --target armv7-unknown-linux-gnueabihf - - name: docker pull - run: docker pull ghcr.io/immunant/rav1d/debian-bullseye-arm7:latest - - name: build and run tests in docker + RUSTFLAGS="-C target-feature=+crt-static -C linker=arm-linux-gnueabihf-gcc" \ + cargo build --release --target armv7-unknown-linux-gnueabihf + - name: run tests run: | - docker run \ - --rm \ - -v ~/.cargo/git:/home/prossimo/.cargo/git \ - -v ~/.cargo/registry:/home/prossimo/.cargo/registry \ - -v $(pwd):/${{ github.workspace }} \ - -w ${{ github.workspace }} \ - --platform linux/arm/v7 \ - ghcr.io/immunant/rav1d/debian-bullseye-arm7:latest \ - .github/workflows/test.sh -t 2 \ - -r target/armv7-unknown-linux-gnueabihf/release/dav1d \ - -s target/armv7-unknown-linux-gnueabihf/release/seek_stress + .github/workflows/test.sh -t 2 \ + -r target/armv7-unknown-linux-gnueabihf/release/dav1d \ + -s target/armv7-unknown-linux-gnueabihf/release/seek_stress - name: upload build artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v3