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-10-28 05:55:49 +03:00
|
|
|
key: cargo-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
cargo-release-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
2021-06-23 13:50:27 +03:00
|
|
|
- name: Build (release)
|
|
|
|
run: |
|
2021-10-28 05:55:49 +03:00
|
|
|
yarn
|
|
|
|
yarn build
|
2021-06-23 13:50:27 +03:00
|
|
|
|
|
|
|
- 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
|
2021-10-28 05:55:49 +03:00
|
|
|
|
2021-04-30 09:25:24 +03:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./cache
|
|
|
|
~/.cargo/
|
|
|
|
target
|
2021-10-28 05:55:49 +03:00
|
|
|
key: cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
cargo-bench-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
2021-11-15 18:38:03 +03:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly-2021-09-30
|
|
|
|
override: true
|
|
|
|
|
2021-04-30 09:25:24 +03:00
|
|
|
- name: Run benchmark
|
2021-11-15 18:38:03 +03:00
|
|
|
run: cargo +nightly-2021-09-30 bench --all --exclude swc_plugin | tee output.txt
|
2021-06-23 13:50:27 +03:00
|
|
|
|
2021-10-18 10:54:23 +03:00
|
|
|
- name: Download previous benchmark results
|
|
|
|
run: mkdir raw-data && curl -o raw-data/benchmark-data.json https://raw.githubusercontent.com/swc-project/raw-data/gh-pages/benchmark-data.json
|
|
|
|
|
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
|
|
|
|
|
2021-10-18 10:54:23 +03:00
|
|
|
- name: Analyze benchmark result (root)
|
2021-10-29 09:11:00 +03:00
|
|
|
if: ${{ github.event_name == 'push' }}
|
2021-10-18 10:54:23 +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
|
|
|
|
external-data-json-path: ./raw-data/benchmark-data.json
|
|
|
|
# Workflow will fail when an alert happens
|
2021-10-19 22:01:30 +03:00
|
|
|
# fail-on-alert: true
|
2021-10-18 10:54:23 +03:00
|
|
|
# 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
|
2021-10-26 10:23:34 +03:00
|
|
|
max-items-in-chart: 250
|
2021-10-18 10:54:23 +03:00
|
|
|
|
2021-06-23 13:50:27 +03:00
|
|
|
- name: Deploy
|
2021-11-15 10:52:45 +03:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2021-06-23 13:50:27 +03:00
|
|
|
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"
|