Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run benchmarks on dedicated CI runner #64

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

name: Run benchmarks
name: Tests

on:
push:
Expand All @@ -12,8 +12,8 @@ on:
- '**'

jobs:
max-cost-checks:
name: Cost checks
tests:
name: Unit Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -70,18 +70,53 @@ jobs:
run: |
pytest tests

benchmarks:
name: Generator performance
runs-on: benchmark
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: chia-network/actions/setup-python@main
name: Install Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}

- name: Set up rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: setup venv
run: |
python -m venv venv

- uses: chia-network/actions/activate-venv@main

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install maturin colorama clvm_tools
rustup target add x86_64-unknown-linux-musl

- name: Build
env:
CC: gcc
run: |
maturin develop --release -m wheel/Cargo.toml

- name: test generators
if: matrix.os == 'ubuntu-latest'
# TODO: This should happen everywhere but the benchmarking part is not passing
# on all platforms so this can be revisited separately.
run: |
cd tests
./test-generators.py

- name: Run cost checks
if: matrix.os == 'ubuntu-latest'
# TODO: This should happen everywhere but the benchmarking part is not passing
# on all platforms so this can be revisited separately.
run: |
cd tests
./generate-programs.py
Expand Down
2 changes: 1 addition & 1 deletion tests/test-generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def parse_output(result, error_code) -> str:
limit = 6

if run_time > limit or run_time2 > limit:
print("run-time exceeds limit!")
print(f"run-time exceeds limit ({limit})!")
failed = 1

print(f"returning {failed}")
Expand Down