Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cargo-binstall to fast install critcmp for benchmark-compare #3637

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
116 changes: 59 additions & 57 deletions .github/workflows/benchmark.yaml
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: "PR - Install Rust toolchain"
run: rustup show

- uses: Swatinem/rust-cache@v1
- uses: Swatinem/rust-cache@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, thx


- name: "PR - Build benchmarks"
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -75,59 +75,61 @@ jobs:
- run-benchmark

steps:
- name: "Install Rust toolchain"
run: rustup show

- name: "Install critcmp"
# Use debug build: Building takes much longer than the "slowness" of using the debug build.
run: cargo install --debug critcmp

- name: "Linux | Download PR benchmark results"
uses: actions/download-artifact@v3
with:
name: benchmark-results-ubuntu-latest
path: ./target/criterion

- name: "Linux | Compare benchmark results"
shell: bash
run: |
echo "### Benchmark" >> summary.md
echo "#### Linux" >> summary.md
echo "\`\`\`" >> summary.md
critcmp main pr >> summary.md
echo "\`\`\`" >> summary.md
echo "" >> summary.md

- name: "Linux | Cleanup benchmark results"
run: rm -rf ./target/criterion

- name: "Windows | Download PR benchmark results"
uses: actions/download-artifact@v3
with:
name: benchmark-results-windows-latest
path: ./target/criterion

- name: "Windows | Compare benchmark results"
shell: bash
run: |
echo "#### Windows" >> summary.md
echo "\`\`\`" >> summary.md
critcmp main pr >> summary.md
echo "\`\`\`" >> summary.md
echo "" >> summary.md

echo ${{ github.event.pull_request.number }} > pr-number

cat summary.md > $GITHUB_STEP_SUMMARY

- uses: actions/upload-artifact@v3
name: Upload PR Number
with:
name: pr-number
path: pr-number

- uses: actions/upload-artifact@v3
name: Upload Summary
with:
name: summary
path: summary.md
- name: "Install Rust toolchain"
run: rustup show

- name: "Install cargo-binstall"
uses: taiki-e/install-action@cargo-binstall

- name: "Install critcmp"
run: cargo binstall critcmp -y

- name: "Linux | Download PR benchmark results"
uses: actions/download-artifact@v3
with:
name: benchmark-results-ubuntu-latest
path: ./target/criterion

- name: "Linux | Compare benchmark results"
shell: bash
run: |
echo "### Benchmark" >> summary.md
echo "#### Linux" >> summary.md
echo "\`\`\`" >> summary.md
critcmp main pr >> summary.md
echo "\`\`\`" >> summary.md
echo "" >> summary.md

- name: "Linux | Cleanup benchmark results"
run: rm -rf ./target/criterion

- name: "Windows | Download PR benchmark results"
uses: actions/download-artifact@v3
with:
name: benchmark-results-windows-latest
path: ./target/criterion

- name: "Windows | Compare benchmark results"
shell: bash
run: |
echo "#### Windows" >> summary.md
echo "\`\`\`" >> summary.md
critcmp main pr >> summary.md
echo "\`\`\`" >> summary.md
echo "" >> summary.md

echo ${{ github.event.pull_request.number }} > pr-number

cat summary.md > $GITHUB_STEP_SUMMARY

- uses: actions/upload-artifact@v3
name: Upload PR Number
with:
name: pr-number
path: pr-number

- uses: actions/upload-artifact@v3
name: Upload Summary
with:
name: summary
path: summary.md