[bug] A dependency cycle has been detected for (unknown) #909
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
# Thanks to Rome! https://github.com/rome/tools/blob/main/.github/workflows/bench_parser.yml | |
# Bump | |
name: Benchmark | |
on: | |
issue_comment: | |
types: [created] | |
# pull_request: | |
env: | |
RUST_LOG: info | |
jobs: | |
bench: | |
name: Bench | |
if: github.event.issue.pull_request && contains(github.event.comment.body, '!benchmark') | |
runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# bench: [dep_graph_benchmark, emitter_benchmark, pipeline_benchmark] | |
# fail-fast: false | |
steps: | |
- run: echo ${{ github.event.pull_request.head.sha }} | |
- name: Get PR SHA | |
id: sha | |
uses: actions/github-script@v6 | |
with: | |
result-encoding: string | |
script: | | |
const response = await github.request(context.payload.issue.pull_request.url); | |
return response.data.head.sha; | |
- name: Checkout PR branch | |
uses: actions/checkout@v4 | |
with: | |
submodules: false | |
ref: ${{ steps.sha.outputs.result }} | |
# ref: ${{ github.event.pull_request.head.sha }} | |
- uses: moonrepo/setup-rust@v1 | |
- name: Run benchmarks | |
# args: --workspace --bench ${{ matrix.bench }} -- --save-baseline base-sha | |
run: | |
cargo bench --workspace --bench dep_graph_benchmark --bench emitter_benchmark --bench | |
pipeline_benchmark --bench tar_benchmark -- --save-baseline head-sha | |
# Run on base branch to get a baseline | |
- name: Checkout base branch | |
uses: actions/checkout@v4 | |
with: | |
clean: false | |
ref: ${{ github.event.pull_request.base.sha }} | |
- name: Run benchmarks | |
# args: --workspace --bench ${{ matrix.bench }} -- --save-baseline base-sha | |
run: | |
cargo bench --workspace --bench dep_graph_benchmark --bench emitter_benchmark --bench | |
pipeline_benchmark --bench tar_benchmark -- --save-baseline base-sha | |
# Compare diffs | |
- name: Install critcmp | |
run: cargo install critcmp | |
- name: Compare benchmarks | |
id: bench_comparison | |
shell: bash | |
run: | | |
echo "comment<<EOF" >> $GITHUB_OUTPUT | |
echo "### Benchmark results" >> $GITHUB_OUTPUT | |
echo "\`\`\`" >> $GITHUB_OUTPUT | |
critcmp base-sha head-sha >> $GITHUB_OUTPUT | |
echo "\`\`\`" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Add comment | |
uses: peter-evans/create-or-update-comment@v2 | |
continue-on-error: true | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: ${{ steps.bench_comparison.outputs.comment }} | |
- name: Remove artifacts | |
run: rm -rf ./target/criterion |