Skip to content

add: bench.yml

add: bench.yml #1

Workflow file for this run

name: test
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
push:
branches:
- bench
env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
LC_ALL: en_US.UTF-8 # This prevents strace from changing it's number format to use commas.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
bench:
strategy:
fail-fast: false
matrix:
rust: [stable]
node: ["14"]
python: ["3.10"]
hyperfine: ["1.11.0"]
platform:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.target }}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install -y xvfb
wget https://github.com/sharkdp/hyperfine/releases/download/v${{ matrix.hyperfine }}/hyperfine_${{ matrix.hyperfine }}_amd64.deb
sudo dpkg -i hyperfine_${{ matrix.hyperfine }}_amd64.deb
pip install memory_profiler
- name: build electron hello_world
run: |
cd apps/hello_world
yarn && yarn package
- name: build electron cpu_intensive
run: |
cd apps/cpu_intensive
yarn && yarn package
- name: build electron file_transfer
run: |
cd apps/file_transfer
yarn && yarn package
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bench/tools
- name: build benchmarks
run: |
xvfb-run --auto-servernum cargo bench
- name: clone current benchmarks
if: github.repository == 'tauri-apps/benchmark_electron' && github.ref == 'refs/heads/dev'
uses: actions/checkout@v2
with:
token: ${{ secrets.BENCH_PAT }}
path: gh-pages
repository: tauri-apps/benchmark_results
- name: post benchmarks
if: github.repository == 'tauri-apps/benchmark_electron' && github.ref == 'refs/heads/dev'
run: |
cargo run --manifest-path ./bench/tools/Cargo.toml --bin build_benchmark_jsons
cd gh-pages
git pull
git config user.name "tauri-bench"
git config user.email "[email protected]"
git add .
git commit --message "Update Electron benchmarks"
git push origin gh-pages
- name: Worker info
run: |
cat /proc/cpuinfo
cat /proc/meminfo