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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- name: "PR - Install Rust toolchain" | ||
run: rustup show | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: "PR - Build benchmarks" | ||
uses: actions-rs/cargo@v1 | ||
|
@@ -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 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered adding rust-cache to the critcmp step but decided against it because GitHub limits the cache per repository to 10GB. That means GitHub starts evicting cached artifacts once we exceed the 10GB limit. You can see all our cache artifacts here. Now, the reason I excluded I don't know if that's the right call, nor have I verified my assumption that caching the c I researched more to find ways to avoid building So what if we could avoid running
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be necessary as far as I understand. You can use ❯ cargo binstall critcmp -y
INFO resolve: Resolving package: 'critcmp'
WARN The package critcmp v0.1.7 will be downloaded from third-party source QuickInstall
INFO This will install the following binaries:
INFO - critcmp (critcmp -> /home/micha/.cargo/bin/critcmp-v0.1.7)
INFO And create (or update) the following symlinks:
INFO - critcmp (/home/micha/.cargo/bin/critcmp -> critcmp-v0.1.7)
INFO Installing binaries...
INFO Done in 2.070975169s |
||
|
||
- 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, thx