Skip to content

Commit

Permalink
ci: Build -musl for native tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wcampbell0x2a committed Jun 24, 2023
1 parent c2a1183 commit bf99fe9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# - https://github.com/alexcrichton/xz2-rs/pull/111
CFLAGS = "-D NDEBUG=1 -D HAVE_DECODER_ARM=1 -D HAVE_ENCODER_ARM=1 -D HAVE_DECODER_ARM64=1 -D HAVE_ENCODER_ARM64=1 -D HAVE_DECODER_ARMTHUMB=1 -D HAVE_ENCODER_ARMTHUMB=1 -D HAVE_DECODER_IA64=1 -D HAVE_ENCODER_IA64=1"

[build]
[target."x86_64-unknown-linux-musl"]
rustflags = ["-C", "target-feature=+crt-static"]
2 changes: 2 additions & 0 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
# release binaries
release-bins:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-features=+crt-static"
strategy:
matrix:
targets:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
# build all supported targets for library and bins
build-test:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-features=+crt-static"
strategy:
matrix:
target:
Expand Down Expand Up @@ -47,9 +49,11 @@ jobs:
# test with cross
- run: CROSS_CONTAINER_OPTS="--network host" RUST_LOG=info cross test --release ${{ matrix.features }} --features __fast-test --target ${{ matrix.target }} --locked

# build all supported on native arch for library and bins
# build all supported on native(musl) arch for library and bins
build-test-native:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-features=+crt-static"
strategy:
matrix:
toolchain:
Expand All @@ -72,9 +76,8 @@ jobs:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
# install cross
# test with cross
- run: RUST_LOG=info cargo test --release ${{ matrix.features }} --locked
- run: RUST_LOG=info cargo test --target x86_64-unknown-linux-musl --release ${{ matrix.features }} --locked


# benchmark
Expand Down

0 comments on commit bf99fe9

Please sign in to comment.