Skip to content

Commit 094023a

Browse files
committed
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.)
1 parent e94526e commit 094023a

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

.github/workflows/ci.yml

+26-15
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,28 @@ jobs:
198198
test-32bit:
199199
runs-on: ubuntu-latest
200200

201+
env:
202+
TARGET: i686-unknown-linux-musl
203+
204+
steps:
205+
- uses: actions/checkout@v4
206+
- uses: dtolnay/rust-toolchain@master
207+
with:
208+
toolchain: stable
209+
targets: ${{ env.TARGET }}
210+
- uses: Swatinem/rust-cache@v2
211+
- uses: taiki-e/install-action@v2
212+
with:
213+
tool: nextest
214+
- name: Test (nextest)
215+
run: cargo nextest run --target "$TARGET" --workspace --no-fail-fast
216+
217+
test-32bit-cross:
218+
runs-on: ubuntu-latest
219+
201220
strategy:
202221
matrix:
203-
target:
204-
- i686-unknown-linux-musl
205-
- armv7-linux-androideabi
206-
include:
207-
- target: i686-unknown-linux-musl
208-
cargo: cargo
209-
package-to-test: gix # Without cross, can test gix. Fixture scripts use amd64 git.
210-
- target: armv7-linux-androideabi
211-
cargo: cross
212-
package-to-test: gix-hashtable # With cross, can't test gix. Fixture scripts need armv7 git.
213-
fail-fast: false # FIXME: Remove this after testing.
222+
target: [ armv7-linux-androideabi ]
214223

215224
steps:
216225
- uses: actions/checkout@v4
@@ -222,15 +231,16 @@ jobs:
222231
toolchain: stable
223232
targets: ${{ matrix.target }}
224233
- name: Install cross
225-
if: matrix.cargo == 'cross'
226234
uses: taiki-e/install-action@v2
227235
with:
228236
tool: cross
229237
- name: check
230-
run: ${{ matrix.cargo }} check -p gix --target ${{ matrix.target }}
238+
run: cross check -p gix --target ${{ matrix.target }}
231239
- name: Test (unit)
232-
# Run high-level unit tests that exercise a lot of code while being pure Rust to ease building test binaries.
233-
run: ${{ matrix.cargo }} test -p ${{ matrix.package-to-test }} --target ${{ matrix.target }}
240+
run: |
241+
# Run some high-level unit tests that exercise various pure Rust code to ease building test binaries.
242+
# We would prefer `-p gix`. But with `cross`, fixture scripts try to run amd64 `git` as an armv7 binary.
243+
cross test -p gix-hashtable --target ${{ matrix.target }}
234244
235245
lint:
236246
runs-on: ubuntu-latest
@@ -407,6 +417,7 @@ jobs:
407417
- test-journey
408418
- test-fast
409419
- test-32bit
420+
- test-32bit-cross
410421
- lint
411422
- cargo-deny
412423
- check-packetline

0 commit comments

Comments
 (0)