Release #1550
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 | |
env: | |
DEBUG: 'napi:*' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
bench: | |
name: Bench | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/brooooooklyn/canvas/ubuntu-builder:jammy | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Output toolchain | |
id: toolchain | |
shell: bash | |
run: echo "version=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" | |
- name: Install | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-apple-darwin | |
toolchain: ${{ steps.toolchain.outputs.version }} | |
- name: Cache cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: bench-cargo-cache | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Download skia binary | |
run: | | |
git config --global --add safe.directory $(pwd) | |
node ./scripts/release-skia-binary.js --download | |
- name: 'Build' | |
run: yarn build | |
- name: 'Run benchmark' | |
run: yarn bench | |
- name: Store benchmark result | |
uses: rhysd/github-action-benchmark@v1 | |
if: github.ref == 'refs/heads/main' | |
with: | |
tool: 'benchmarkjs' | |
output-file-path: bench.txt | |
github-token: ${{ secrets.GH_TOKEN }} | |
auto-push: true | |
- name: Store benchmark result | |
uses: rhysd/github-action-benchmark@v1 | |
continue-on-error: true | |
if: github.ref != 'refs/heads/main' | |
with: | |
tool: 'benchmarkjs' | |
output-file-path: bench.txt | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-always: true | |
- name: Clear the cargo caches | |
run: | | |
cargo install cargo-cache --no-default-features --features ci-autoclean | |
cargo-cache |