Skip to content

Commit

Permalink
Split i686 and armv7 jobs; run all tests on i686
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
EliahKagan committed Nov 13, 2024
1 parent 3911966 commit 1d243f2
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -355,6 +365,7 @@ jobs:
- test
- test-fast
- test-32bit
- test-32bit-cross
- lint
- cargo-deny
- check-packetline
Expand Down

0 comments on commit 1d243f2

Please sign in to comment.