mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:34:57 +00:00
Add Swatinem/rust-cache to benchmark-compare job (#3637)
This commit is contained in:
parent
f59a22b6e5
commit
c42f8b93d2
1 changed files with 49 additions and 47 deletions
96
.github/workflows/benchmark.yaml
vendored
96
.github/workflows/benchmark.yaml
vendored
|
@ -26,7 +26,7 @@ jobs:
|
||||||
- name: "PR - Install Rust toolchain"
|
- name: "PR - Install Rust toolchain"
|
||||||
run: rustup show
|
run: rustup show
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: "PR - Build benchmarks"
|
- name: "PR - Build benchmarks"
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
|
@ -75,59 +75,61 @@ jobs:
|
||||||
- run-benchmark
|
- run-benchmark
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Install Rust toolchain"
|
- name: "Install Rust toolchain"
|
||||||
run: rustup show
|
run: rustup show
|
||||||
|
|
||||||
- name: "Install critcmp"
|
- name: "Install cargo-binstall"
|
||||||
# Use debug build: Building takes much longer than the "slowness" of using the debug build.
|
uses: taiki-e/install-action@cargo-binstall
|
||||||
run: cargo install --debug critcmp
|
|
||||||
|
|
||||||
- name: "Linux | Download PR benchmark results"
|
- name: "Install critcmp"
|
||||||
uses: actions/download-artifact@v3
|
run: cargo binstall critcmp -y
|
||||||
with:
|
|
||||||
name: benchmark-results-ubuntu-latest
|
|
||||||
path: ./target/criterion
|
|
||||||
|
|
||||||
- name: "Linux | Compare benchmark results"
|
- name: "Linux | Download PR benchmark results"
|
||||||
shell: bash
|
uses: actions/download-artifact@v3
|
||||||
run: |
|
with:
|
||||||
echo "### Benchmark" >> summary.md
|
name: benchmark-results-ubuntu-latest
|
||||||
echo "#### Linux" >> summary.md
|
path: ./target/criterion
|
||||||
echo "\`\`\`" >> summary.md
|
|
||||||
critcmp main pr >> summary.md
|
|
||||||
echo "\`\`\`" >> summary.md
|
|
||||||
echo "" >> summary.md
|
|
||||||
|
|
||||||
- name: "Linux | Cleanup benchmark results"
|
- name: "Linux | Compare benchmark results"
|
||||||
run: rm -rf ./target/criterion
|
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: "Windows | Download PR benchmark results"
|
- name: "Linux | Cleanup benchmark results"
|
||||||
uses: actions/download-artifact@v3
|
run: rm -rf ./target/criterion
|
||||||
with:
|
|
||||||
name: benchmark-results-windows-latest
|
|
||||||
path: ./target/criterion
|
|
||||||
|
|
||||||
- name: "Windows | Compare benchmark results"
|
- name: "Windows | Download PR benchmark results"
|
||||||
shell: bash
|
uses: actions/download-artifact@v3
|
||||||
run: |
|
with:
|
||||||
echo "#### Windows" >> summary.md
|
name: benchmark-results-windows-latest
|
||||||
echo "\`\`\`" >> summary.md
|
path: ./target/criterion
|
||||||
critcmp main pr >> summary.md
|
|
||||||
echo "\`\`\`" >> summary.md
|
|
||||||
echo "" >> summary.md
|
|
||||||
|
|
||||||
echo ${{ github.event.pull_request.number }} > pr-number
|
- 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
|
||||||
|
|
||||||
cat summary.md > $GITHUB_STEP_SUMMARY
|
echo ${{ github.event.pull_request.number }} > pr-number
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
cat summary.md > $GITHUB_STEP_SUMMARY
|
||||||
name: Upload PR Number
|
|
||||||
with:
|
|
||||||
name: pr-number
|
|
||||||
path: pr-number
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
name: Upload Summary
|
name: Upload PR Number
|
||||||
with:
|
with:
|
||||||
name: summary
|
name: pr-number
|
||||||
path: summary.md
|
path: pr-number
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
name: Upload Summary
|
||||||
|
with:
|
||||||
|
name: summary
|
||||||
|
path: summary.md
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue