diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 08ab910..b1613d5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -89,26 +89,30 @@ jobs: cargo install x86-instruction-set-analyzer --version 0.1.0 cargo build # Build without RUSTFLAGS + echo "Running -C target_cpu=x86-64..." + echo export RUSTFLAGS="-C target_cpu=x86-64" target/debug/cargo-zigbuild zigbuild --manifest-path tests/target-cpu/Cargo.toml --target x86_64-unknown-linux-gnu --release x86-instruction-set-analyzer tests/target-cpu/target/x86_64-unknown-linux-gnu/release/target-cpu | tee output.txt - grep 'AVX2' output.txt &> /dev/null - if [ $? == 0 ]; then - echo "Test fail, should not contain AVX2 instruction set in target_cpu=x86-64" + echo + if grep -q 'AVX2' output.txt; then + echo "Test fail, should not contain AVX2 instruction set" false else echo "Test pass" fi + echo "Running -C target_cpu=x86-64-v4..." + echo export RUSTFLAGS="-C target_cpu=x86-64-v4" target/debug/cargo-zigbuild zigbuild --manifest-path tests/target-cpu/Cargo.toml --target x86_64-unknown-linux-gnu --release x86-instruction-set-analyzer tests/target-cpu/target/x86_64-unknown-linux-gnu/release/target-cpu | tee output.txt - grep 'AVX2' output.txt &> /dev/null - if [ $? = 0 ]; then - echo "Test pass" - else - echo "Test fail, should contain AVX2 instruction set in target_cpu=x86-64-v4" + echo + if ! grep -q 'AVX2' output.txt; then + echo "Test fail, should contain AVX2 instruction set" false + else + echo "Test pass" fi - name: macOS - Test build run: |