Skip to content

Commit

Permalink
Update CI workflow and test script to work after 05e2ddd
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTMjugador committed Feb 26, 2025
1 parent cff69f5 commit 3174cf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ jobs:
| sarif-fmt
- name: Run tests
run: make zopfli && make test
run: |
cargo test --release
cargo build --release && ./test/run.sh
- name: Run tests (no-std)
run: cargo test --release --no-default-features
Expand Down
9 changes: 5 additions & 4 deletions test/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
set -eu
#!/bin/bash -eu
set -o pipefail

# Clean output from previous runs
Expand All @@ -8,7 +7,8 @@ rm -f test/data/*.gz
# Test all input cases individually so we can report which failed
for input in test/data/*; do
printf "Compressing ${input}... "
env RUST_BACKTRACE=1 ./zopfli ${input} && echo "done"
RUST_BACKTRACE=1 target/release/zopfli ${input}
echo "done"
done

# Move newly compressed data to its own directory
Expand All @@ -24,7 +24,8 @@ for gz in test/results/*.gz; do
BASENAME=$(basename -s .gz $gz)
printf "Validating ${gz}... "
cat $gz | gzip -d > test/temp_decompressed/${BASENAME}
diff -r test/data/${BASENAME} test/temp_decompressed/${BASENAME} && echo "done"
diff -r test/data/${BASENAME} test/temp_decompressed/${BASENAME}
echo "done"
done

# Clean up temporary output
Expand Down

0 comments on commit 3174cf9

Please sign in to comment.