calc abs max short #560
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dynamic fuzz | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# Check if files in the /test, /crates, or /lib directories or the | |
# /Cargo.lock, or /Cargo.toml files were changed in this PR. | |
detect-changes: | |
uses: ./.github/workflows/check_diff.yml | |
with: | |
pattern: ^test/\|^crates/\|^lib/\|^target/\|^Cargo\.lock$\|^Cargo\.toml$\|^\.github/workflows/dynamic_fuzz\.yml$ | |
test: | |
name: extended fuzz on new tests | |
runs-on: ubuntu-latest | |
needs: detect-changes | |
if: needs.detect-changes.outputs.changed == 'true' | |
steps: | |
- name: Checkout hyperdrive-rs | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# NOTE: This is needed to ensure that hyperdrive-wrappers builds correctly. | |
- name: install foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2024-05-02 | |
override: true | |
components: rustfmt, clippy | |
- name: Get list of tests from main branch | |
run: | | |
git remote update && git fetch && git checkout --track origin/main | |
sh scripts/list_tests.sh > main_tests.txt | |
- name: Get list of tests from pull request branch | |
run: | | |
git checkout ${{ github.head_ref }} | |
sh scripts/list_tests.sh > branch_tests.txt | |
- name: Compare test lists and run new tests with 10x fuzz runs | |
run: | | |
new_tests=$(diff main_tests.txt branch_tests.txt|awk -F'[>,]' '{gsub(/ /,"")} {print $2} '| sed '/^$/d') | |
if [ -n "$new_tests" ]; then | |
echo "New tests found:" | |
echo "$new_tests" | |
while IFS= read -r test; do | |
echo "Running test: $test" | |
env HYPERDRIVE_SLOW_FUZZ_RUNS=500 HYPERDRIVE_FUZZ_RUNS=1000 HYPERDRIVE_FAST_FUZZ_RUNS=100000 cargo test --release $test -- | |
done <<< "$new_tests" | |
else | |
echo "No new tests found." | |
fi |