adding code cov workflow file to workflows list #7739
Workflow file for this run
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: Benchmark PR (iai) | |
| on: | |
| pull_request: | |
| branches: [ '**' ] | |
| jobs: | |
| fetch-iai-results: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.base.sha }} | |
| - name: Initialize IAI cache for ${{ github.event.pull_request.base.sha }} | |
| uses: actions/cache@v3 | |
| id: cache-iai-results | |
| with: | |
| path: | | |
| */target/iai/iai_benchmark/ | |
| key: ${{ runner.os }}-iai-benchmark-cache-${{ github.event.pull_request.base.sha }} | |
| lookup-only: true | |
| - name: Install Rust | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| uses: dtolnay/rust-toolchain@1.89.0 | |
| - name: Set up cargo cache | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install uv | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install python deps | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| run: | | |
| uv python install 3.9.15 | |
| uv venv --python 3.9.15 cairo-vm-env | |
| . cairo-vm-env/bin/activate | |
| uv pip install -r requirements.txt | |
| echo PATH=$PATH >> $GITHUB_ENV | |
| - name: Install test dependencies | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| run: | | |
| sudo apt update | |
| sudo apt install -y valgrind | |
| IAI_VERSION=$(grep '^iai-callgrind' vm/Cargo.toml | sed 's/.*"\(.*\)"/\1/') | |
| cargo install --version $IAI_VERSION iai-callgrind-runner | |
| - name: Run iai benchmarks | |
| if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} | |
| run: make iai-benchmark-action | |
| run-iai-benchmark: | |
| needs: fetch-iai-results | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@1.89.0 | |
| - name: Set up cargo cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Install python deps | |
| run: | | |
| uv python install 3.9.15 | |
| uv venv --python 3.9.15 cairo-vm-env | |
| . cairo-vm-env/bin/activate | |
| uv pip install -r requirements.txt | |
| echo PATH=$PATH >> $GITHUB_ENV | |
| - name: Install test dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y valgrind | |
| IAI_VERSION=$(grep '^iai-callgrind' vm/Cargo.toml | sed 's/.*"\(.*\)"/\1/') | |
| cargo install --version $IAI_VERSION iai-callgrind-runner | |
| - name: Restore cache for ${{ github.event.pull_request.base.sha }} | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: | | |
| */target/iai/iai_benchmark/ | |
| key: ${{ runner.os }}-iai-benchmark-cache-${{ github.event.pull_request.base.sha }} | |
| fail-on-cache-miss: true | |
| - name: Run iai benchmarks | |
| run: make iai-benchmark-action |