From c42f8b93d2829f7d509375e926519a94d618e1ab Mon Sep 17 00:00:00 2001 From: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com> Date: Tue, 21 Mar 2023 14:45:09 +0100 Subject: [PATCH] Add Swatinem/rust-cache to benchmark-compare job (#3637) --- .github/workflows/benchmark.yaml | 116 ++++++++++++++++--------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/.github/workflows/benchmark.yaml b/.github/workflows/benchmark.yaml index 48bd53fa6417a..2299272b0739f 100644 --- a/.github/workflows/benchmark.yaml +++ b/.github/workflows/benchmark.yaml @@ -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 + + - 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