|
name: Simple benchmarks |
|
on: |
|
push: |
|
branches: |
|
- main |
|
|
|
permissions: |
|
|
|
deployments: write |
|
|
|
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/ |
|
|
|
- name: Download previous benchmark data |
|
uses: actions/cache@v1 |
|
with: |
|
path: ./cache |
|
key: ${{ runner.os }}-benchmark |
|
|
|
- name: Store benchmark result |
|
uses: benchmark-action/github-action-benchmark@v1 |
|
with: |
|
|
|
tool: 'pytest' |
|
|
|
output-file-path: ./bindings/python/output.json |
|
github-token: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
auto-push: true |
|
comment-on-alert: true |
|
|
|
alert-comment-cc-users: '@Narsil' |
|
|