2021-04-30 09:25:24 +03:00
|
|
|
name: Benchmark
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
2021-06-23 13:50:27 +03:00
|
|
|
binary-size:
|
|
|
|
name: Binary size
|
2021-04-30 09:25:24 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./cache
|
|
|
|
~/.cargo/
|
|
|
|
target
|
2021-06-23 13:50:27 +03:00
|
|
|
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*
|
2021-04-30 09:25:24 +03:00
|
|
|
|
|
|
|
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
|
2021-06-23 13:50:27 +03:00
|
|
|
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/Cargo.toml') }}
|
2021-04-30 09:25:24 +03:00
|
|
|
- name: Run benchmark
|
|
|
|
run: cargo bench --all | tee output.txt
|
2021-06-23 13:50:27 +03:00
|
|
|
|
|
|
|
- name: Analyze benchmark result
|
2021-04-30 09:25:24 +03:00
|
|
|
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
|
2021-04-30 09:25:24 +03:00
|
|
|
# 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
|
2021-06-23 13:50:27 +03:00
|
|
|
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
|
2021-06-24 09:32:09 +03:00
|
|
|
git-config-email: github-bot@swc.rs
|
2021-06-23 13:50:27 +03:00
|
|
|
repository-name: swc-project/raw-data
|
|
|
|
commit-message: "Update"
|