swc/.github/workflows/bench.yml

75 lines
2.1 KiB
YAML
Raw Normal View History

name: Benchmark
on:
- push
- pull_request
jobs:
binary-size:
name: Binary size
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1
with:
path: |
./cache
~/.cargo/
target
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/Cargo.toml') }}
- name: Build (release)
run: |
npm i
npm run build
- name: Print binary size
run: ls -al ./target/release/libnode*
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v1
with:
path: |
./cache
~/.cargo/
target
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/Cargo.toml') }}
- name: Run benchmark
run: cargo bench --all | tee output.txt
- name: Analyze benchmark result
uses: rhysd/github-action-benchmark@v1
with:
# What benchmark tool the output.txt came from
tool: "cargo"
# Where the output from the benchmark tool is stored
output-file-path: output.txt
2021-06-25 11:19:15 +03:00
external-data-json-path: ./raw-data/${{ github.sha }}/benchmark-data.json
# Workflow will fail when an alert happens
fail-on-alert: true
# GitHub API token to make a commit comment
github-token: ${{ secrets.GITHUB_TOKEN }}
# Enable alert commit comment
comment-on-alert: true
comment-always: true
alert-comment-cc-users: "@kdy1"
skip-fetch-gh-pages: true
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
token: ${{ secrets.GH_TOKEN }}
branch: gh-pages
folder: raw-data
2021-06-24 11:01:21 +03:00
clean: false
single-commit: false
git-config-email: github-bot@swc.rs
repository-name: swc-project/raw-data
commit-message: "Update"