Update CI/CD to use pixi and parallel testing; also moving to Python 3.11-3.13 #920
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| pull_request: | |
| branches: ["*"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: ["dev-py310", "dev"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Cache rattler's shared package cache (speeds up downloads) | |
| - name: Restore rattler cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/rattler | |
| key: rattler-${{ runner.os }}-${{ matrix.env }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| rattler-${{ runner.os }}-${{ matrix.env }}- | |
| rattler-${{ runner.os }}- | |
| # Install pixi and the requested environment | |
| - uses: prefix-dev/setup-pixi@v0.9.0 | |
| with: | |
| environments: ${{ matrix.env }} | |
| # No lock committed ⇒ let it resolve fresh each run | |
| locked: false | |
| cache: false # disable lock-based env cache | |
| activate-environment: ${{ matrix.env }} | |
| - name: Show versions | |
| run: | | |
| python --version | |
| pixi --version | |
| - name: Run tests | |
| env: | |
| MPLBACKEND: agg | |
| DISPLAY: ":42" | |
| run: | | |
| pytest -v --cov --color=yes --cov-report=xml | |
| - name: Archive figures generated during testing | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: visual_test_results_${{ matrix.os }}-python${{ matrix.python }} | |
| path: /home/runner/work/spatialdata-plot/spatialdata-plot/tests/figures/* | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| name: coverage | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |