Trying some new CI. (#539) #248
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: Simple benchmarks | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
benchmark: | |
name: Performance regression check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Install Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
architecture: "x64" | |
- name: Install | |
working-directory: ./bindings/python | |
run: | | |
pip install -U pip | |
pip install .[dev] | |
- name: Run tests | |
working-directory: ./bindings/python | |
run: | | |
cargo test | |
pytest --benchmark-json output.json benches/ | |
# Download previous benchmark result from cache (if exists) | |
- name: Download previous benchmark data | |
uses: actions/cache@v1 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
# Run `github-action-benchmark` action | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
# What benchmark tool the output.txt came from | |
tool: 'pytest' | |
# Where the output from the benchmark tool is stored | |
output-file-path: ./bindings/python/output.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Push and deploy GitHub pages branch automatically | |
auto-push: true | |
comment-on-alert: true | |
# Mention @rhysd in the commit comment | |
alert-comment-cc-users: '@Narsil' |