Skip to content

Commit

Permalink
ci: test with disabled target feature
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Sep 29, 2024
1 parent f309355 commit 42a17cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ jobs:
matrix:
target:
- triple: aarch64-unknown-linux-gnu
feature: +neon
feature: neon
- triple: i686-unknown-linux-gnu
feature: +avx2
feature: avx2
- triple: x86_64-unknown-linux-gnu
feature: +avx2
feature: avx2
- triple: wasm32-wasip1
feature: +simd128
feature: simd128
rust: [nightly, stable, 1.64]
exclude:
- target:
triple: wasm32-wasip1
feature: +simd128
feature: simd128
rust: 1.64
timeout-minutes: 30
steps:
Expand All @@ -50,7 +50,7 @@ jobs:
if: matrix.rust == 'nightly'

- name: Enable target feature
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Ctarget-feature=${{ matrix.target.feature }} >> $GITHUB_ENV
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Ctarget-feature=+${{ matrix.target.feature }} >> $GITHUB_ENV

- uses: Swatinem/rust-cache@v2

Expand All @@ -64,6 +64,19 @@ jobs:
- run: cargo bench --no-run
if: matrix.rust == 'nightly'

- name: Disable target feature
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Ctarget-feature=-${{ matrix.target.feature }} >> $GITHUB_ENV

- run: cargo build
- run: cargo build --no-default-features
- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features force-generic
- run: cargo test --no-default-features --features nightly,portable-simd
if: matrix.rust == 'nightly'
- run: cargo bench --no-run
if: matrix.rust == 'nightly'

miri:
name: Miri
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn decode_upper() {
#[cfg(feature = "alloc")]
fn decode_long() {
let s = "608060405234801561001057600080fd5b506040516104913803806104918339818101604052602081101561003357600080fd5b810190808051604051939291908464010000000082111561005357600080fd5b90830190602082018581111561006857600080fd5b825164010000000081118282018810171561008257600080fd5b82525081516020918201929091019080838360005b838110156100af578181015183820152602001610097565b50505050905090810190601f1680156100dc5780820380516001836020036101000a031916815260200191505b50604052505081516100f6915060009060208401906100fd565b505061019e565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826101335760008555610179565b82601f1061014c57805160ff1916838001178555610179565b82800160010185558215610179579182015b8281111561017957825182559160200191906001019061015e565b50610185929150610189565b5090565b5b80821115610185576000815560010161018a565b6102e4806101ad6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063a41368621461003b578063cfae3217146100e3575b600080fd5b6100e16004803603602081101561005157600080fd5b81019060208101813564010000000081111561006c57600080fd5b82018360208201111561007e57600080fd5b803590602001918460018302840111640100000000831117156100a057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610160945050505050565b005b6100eb610177565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561012557818101518382015260200161010d565b50505050905090810190601f1680156101525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b805161017390600090602084019061020d565b5050565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156102035780601f106101d857610100808354040283529160200191610203565b820191906000526020600020905b8154815290600101906020018083116101e657829003601f168201915b5050505050905090565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826102435760008555610289565b82601f1061025c57805160ff1916838001178555610289565b82800160010185558215610289579182015b8281111561028957825182559160200191906001019061026e565b50610295929150610299565b5090565b5b80821115610295576000815560010161029a56fea26469706673582212208b9161dfd195d53618942a72a3b481d61a7b142de919925a0b34f9c986e5707e64736f6c63430007060033";
let _ = const_hex::check(s).unwrap();
const_hex::check(s).unwrap();
assert_eq!(const_hex::decode(s).unwrap(), hex::decode(s).unwrap());
}

Expand Down

0 comments on commit 42a17cf

Please sign in to comment.