Skip to content

Commit

Permalink
Fix CI in set -e
Browse files Browse the repository at this point in the history
Signed-off-by: Wish <[email protected]>
  • Loading branch information
breezewish committed Apr 19, 2024
1 parent cf60543 commit 868ff3c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 868ff3c

Please sign in to comment.