diff --git a/.github/workflows/ci-bench.yml b/.github/workflows/ci-bench.yml index c3adc10d9..34dad34ab 100644 --- a/.github/workflows/ci-bench.yml +++ b/.github/workflows/ci-bench.yml @@ -28,10 +28,21 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - + - name: Run benchmark run: | cd examples ./run_benchmarks.sh cd .. + + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: CN Benchmarks + tool: 'customSmallerIsBetter' + output-file-path: examples/benchmark_results.json + # Access token to deploy GitHub Pages branch + github-token: ${{ secrets.GITHUB_TOKEN }} + # Push and deploy GitHub pages branch automatically + auto-push: true diff --git a/examples/run_benchmarks.sh b/examples/run_benchmarks.sh index f28595735..d41dd38a5 100755 --- a/examples/run_benchmarks.sh +++ b/examples/run_benchmarks.sh @@ -1,8 +1,25 @@ #!/bin/bash +# Define the exclude list +exclude_list=("collatz" "overflow" "sha3-chain") + for file in *; do + # Check if the file is in the exclude list + skip=false + for exclude_file in "${exclude_list[@]}"; do + if [[ "$file" == "$exclude_file" ]]; then + skip=true + echo "skipping excluded example: $file" + break + fi + done + + # If the file is not in the exclude list, process it + if ! $skip; then if [ -d "$file" ]; then echo "Running $file" cargo run --release -p "$file" fi + fi + done