Benchmarks #10
This file contains hidden or 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: Benchmarks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| rust-benchmarks: | |
| name: Run Rust benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup rust toolchain, cache and cargo-codspeed binary | |
| uses: moonrepo/setup-rust@v1 | |
| with: | |
| bins: cargo-codspeed | |
| cache-target: release | |
| inherit-toolchain: true | |
| - name: Setup test data | |
| run: cargo check -vp test_util | |
| - name: Build | |
| run: cargo codspeed build -p voicevox_core --features load-onnxruntime cpu-and-sample-vvm | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| run: cargo codspeed run | |
| mode: instrumentation | |
| python-benchmarks: | |
| name: Run Python benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup rust toolchain, cache and cargo-codspeed binary | |
| uses: moonrepo/setup-rust@v1 | |
| with: | |
| cache-target: release | |
| inherit-toolchain: true | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Set up Poetry | |
| working-directory: ./crates/voicevox_core_python_api | |
| run: | | |
| pip install --upgrade poetry | |
| poetry install --with dev --with test | |
| - name: Setup test data | |
| run: cargo check -vp test_util | |
| - name: Build | |
| working-directory: ./crates/voicevox_core_python_api | |
| run: poetry run maturin develop --locked --profile release -v | |
| - name: Run the benchmarks | |
| uses: CodSpeedHQ/action@v4 | |
| with: | |
| run: poetry run pytest ./python/benches/ --codspeed | |
| mode: instrumentation | |
| working-directory: ./crates/voicevox_core_python_api |