Skip to content

ready to check

ready to check #4

name: Benchmarks and build time

Check failure on line 1 in .github/workflows/benchmarks_and_build.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/benchmarks_and_build.yml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: iai-callgrind
on:
push:
branches:
- "**"
pull_request:
branches: [main]
types: [opened, reopened, synchronize]
workflow_dispatch:
inputs:
branch:
description: "Branch to run benchmark on"
required: true
default: "main"
jobs:
Criterion_benchmarks:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run json_like_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: json_like_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run impl_path_string_for_evaluation_context
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: impl_path_string_for_evaluation_context
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run data_loader_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: data_loader_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run request_template_bench
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
uses: boa-dev/[email protected]
with:
benchName: request_template_bench
defaultFeatures: false
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Benchmark Changes
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
run: |
output=$(/home/runner/.cargo/bin/critcmp base changes)
echo "$output"
awk 'NR > 2 {
group=$1
base=$7
changes=$3
gsub(/[^\-0-9\.]/, "", changes)
gsub(/[^\-0-9\.]/, "", base)
if (changes != "" && base != "") {
diff = changes - base
percentage = (diff / base) * 100
if (percentage > 10) {
printf "Percentage change for %s exceeds 10%%: %.2f%%\n", group, percentage
exit 1
}
}
}' <<< "$output"
iai-callgrind:
name: iai-callgrind
on:
push:
branches:
- "**"
release:
types:
- published
jobs:
benchmark:
name: build_time_check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install iai-callgrind-runner
run: cargo install --version 0.7.3 iai-callgrind-runner
- name: Install Valgrind
run: sudo apt-get update && sudo apt-get install valgrind
- name: Run Benchmarks
run: |
echo -n > benches/iai-callgrind/benchmarks.txt
cargo bench --bench json_like_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench data_loader_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench impl_path_string_for_evaluation_context_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
cargo bench --bench request_template_bench_iai-callgrind -- --save-baseline change >> benches/iai-callgrind/benchmarks.txt
- name: Manipulate Benchmark File
run: sed -i 's/ \{1,\}\([0-9]\)/\1/g' benches/iai-callgrind/benchmarks.txt
- name: Execute build_time_compare.sh
run: |
chmod +x .github/scripts/build_time_compare.sh
./.github/scripts/build_time_compare.sh