Skip to content

Commit

Permalink
Run huff tests on the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 committed Jan 22, 2024
1 parent b127685 commit de7fd88
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

huff-tests:
name: Foundry tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Huff
uses: huff-language/huff-toolchain@v2
with:
version: nightly

- name: Run tests
run: bash ./run_huff_tests.sh

foundry-tests:
name: Foundry tests
runs-on: ubuntu-latest
Expand All @@ -131,6 +147,11 @@ jobs:
with:
version: nightly

- name: Install Huff
uses: huff-language/huff-toolchain@v2
with:
version: nightly

- name: Run tests
run: FOUNDRY_FUZZ_RUNS=2048 MAX_ARRAY_LEN=32 forge test -vvv

Expand All @@ -147,5 +168,10 @@ jobs:
with:
version: nightly

- name: Install Huff
uses: huff-language/huff-toolchain@v2
with:
version: nightly

- name: Run tests
run: FOUNDRY_FUZZ_RUNS=1024 forge test -vvv
17 changes: 17 additions & 0 deletions run_huff_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

for file in $(find ./src -type f -name '*.huff'); do
echo "Testing $file..."
output=$(huffc "$file" test 2>&1)
echo "$output"

# Check for the presence of [FAIL] that is not part of another word like [PASS]
if echo "$output" | grep -E 'FAIL' > /dev/null; then
echo "Failure detected in $file"
exit 255
else
echo "Processed $file successfully"
fi
done

echo "All tests completed"

0 comments on commit de7fd88

Please sign in to comment.