From 1d243f2299f1a66ae4a5ac7ac2f230426aa2fb6e Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Wed, 13 Nov 2024 01:06:41 -0500 Subject: [PATCH] Split i686 and armv7 jobs; run all tests on i686 The test failures that appeared with `i686-unknown-linux-musl` are assertions about the size of data structures, where the actual sizes on 32-bit targets are smaller. But these are not the only such failing assertions in the test suite: local testing with `i686-unknown-linux-gnu` on a 32-bit x86 Debian 12 system, and with `i686-pc-windows-msvc` on a 32-bit x86 Windows 10 system, reveals that there are significantly more such failures. About 20 tests usually fail on these platforms, with most failures being of data structure size assertions. To catch such failures when they arise as regressions, it would be useful to have CI coverage of most of the test suite on some 32-bit target. Since no emulation is needed to run i686 binaries on amd64 CI runners, let try `i686-unknown-linux-musl` for this. This doesn't include running tests with `GIX_TEST_IGNORE_ARCHIVES`, because a test that specifically attempts to exercise fixture scripts should run in an environment where the tools being called, including `git`, and `bash` itself, are 32-bit builds. (That could probably be achieved with a `container` job.) --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd0ea35d92d..d64fae20dfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,19 +147,28 @@ jobs: test-32bit: runs-on: ubuntu-latest + env: + TARGET: i686-unknown-linux-musl + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + targets: ${{ env.TARGET }} + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@v2 + with: + tool: nextest + - name: Test (nextest) + run: cargo nextest run --target "$TARGET" --workspace --no-fail-fast + + test-32bit-cross: + runs-on: ubuntu-latest + strategy: matrix: - target: - - i686-unknown-linux-musl - - armv7-linux-androideabi - include: - - target: i686-unknown-linux-musl - cargo: cargo - package-to-test: gix # Without cross, can test gix. Fixture scripts use amd64 git. - - target: armv7-linux-androideabi - cargo: cross - package-to-test: gix-hashtable # With cross, can't test gix. Fixture scripts need armv7 git. - fail-fast: false # FIXME: Remove this after testing. + target: [ armv7-linux-androideabi ] steps: - uses: actions/checkout@v4 @@ -171,15 +180,16 @@ jobs: toolchain: stable targets: ${{ matrix.target }} - name: Install cross - if: matrix.cargo == 'cross' uses: taiki-e/install-action@v2 with: tool: cross - name: check - run: ${{ matrix.cargo }} check -p gix --target ${{ matrix.target }} + run: cross check -p gix --target ${{ matrix.target }} - name: Test (unit) - # Run high-level unit tests that exercise a lot of code while being pure Rust to ease building test binaries. - run: ${{ matrix.cargo }} test -p ${{ matrix.package-to-test }} --target ${{ matrix.target }} + run: | + # Run some high-level unit tests that exercise various pure Rust code to ease building test binaries. + # We would prefer `-p gix`. But with `cross`, fixture scripts try to run amd64 `git` as an armv7 binary. + cross test -p gix-hashtable --target ${{ matrix.target }} lint: runs-on: ubuntu-latest @@ -355,6 +365,7 @@ jobs: - test - test-fast - test-32bit + - test-32bit-cross - lint - cargo-deny - check-packetline