test: expand benchmarks, use codspeed #2
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: CodSpeed Benchmarks | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| # Required for OIDC authentication | |
| permissions: | |
| contents: read | |
| actions: read | |
| id-token: write | |
| jobs: | |
| benchmarks: | |
| # Benchmarks are sharded by functionality: | |
| # - input-io: model/simulation input file I/O | |
| # - output-io: model output file readers | |
| # - pre-post: pre/postprocessing, grids, rasters, arrays, export | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: | |
| - name: "input-io" | |
| files: >- | |
| benchmark_mf6_input.py | |
| benchmark_mf2005_input.py | |
| - name: "output-io" | |
| files: >- | |
| benchmark_cellbudgetfile.py | |
| benchmark_zonebudget.py | |
| benchmark_mf6listbudget.py | |
| benchmark_headfile.py | |
| benchmark_headufile.py | |
| benchmark_formattedfile.py | |
| benchmark_pathlinefile.py | |
| benchmark_endpointfile.py | |
| benchmark_mtlistfile.py | |
| benchmark_sfroutputfile.py | |
| benchmark_ucnfile.py | |
| benchmark_mflistbudget.py | |
| benchmark_mfusglistbudget.py | |
| - name: "pre-post" | |
| files: >- | |
| benchmark_gridintersect.py | |
| benchmark_grids.py | |
| benchmark_rasters.py | |
| benchmark_arrays.py | |
| benchmark_export.py | |
| benchmark_postprocessing.py | |
| name: "benchmarks (${{ matrix.shard.name }})" | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| cache-dependency-glob: "**/pyproject.toml" | |
| - name: Install FloPy with test dependencies | |
| run: uv sync --all-extras | |
| - name: Run benchmarks with CodSpeed | |
| uses: CodSpeedHQ/action@v3 | |
| with: | |
| run: cd autotest/benchmarks && uv run pytest ${{ matrix.shard.files }} --codspeed | |
| env: | |
| CODSPEED_SHARD_NAME: ${{ matrix.shard.name }} |