Skip to content

Commit

Permalink
Add Swatinem/rust-cache to benchmark-compare job (#3637)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse committed Mar 21, 2023
1 parent f59a22b commit c42f8b9
Showing 1 changed file with 59 additions and 57 deletions.
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

- 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

2 comments on commit c42f8b9

@JonathanPlasse
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swatinem/rust-cache was replaced by taiki-e/install-action@cargo-binstall to install critcmp.

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented on c42f8b9 Mar 21, 2023

Choose a reason for hiding this comment

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

Swatinem/rust-cache was replaced by taiki-e/install-action@cargo-binstall to install critcmp.

What sorcery is this? You can comment on commits 😮

Please sign in to comment.