[pull] master from yewstack:master #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Benchmark - core | |
on: | |
pull_request: | |
branches: [master] | |
paths: | |
- .github/workflows/benchmark-core.yml | |
- "packages/yew/**" | |
- "tools/benchmark-core/**" | |
jobs: | |
benchmark-core: | |
name: Benchmark - core | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout master | |
uses: actions/checkout@v4 | |
with: | |
repository: "yewstack/yew" | |
ref: master | |
path: yew-master | |
- name: Checkout pull request | |
uses: actions/checkout@v4 | |
with: | |
path: current-pr | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Restore Rust cache for master | |
uses: Swatinem/rust-cache@v2 | |
with: | |
working-directory: yew-master | |
key: master | |
- name: Restore Rust cache for current pull request | |
uses: Swatinem/rust-cache@v2 | |
with: | |
working-directory: current-pr | |
key: pr | |
- name: Run pull request benchmark | |
run: cargo bench -q > ../output.log | |
working-directory: current-pr/tools/benchmark-core | |
- name: Run master benchmark | |
run: cargo bench -q > ../output.log | |
continue-on-error: true | |
working-directory: yew-master/tools/benchmark-core | |
- name: Make sure master's output log exists | |
run: touch yew-master/tools/output.log | |
- name: Write Pull Request ID | |
run: | | |
echo "${{ github.event.number }}" > .PR_NUMBER | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: benchmark-core | |
path: | | |
.PR_NUMBER | |
yew-master/tools/output.log | |
current-pr/tools/output.log | |
retention-days: 1 |