Replace pip with uv for test workflow (#877) #42
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: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -e {0} # -e to fail on error | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.10", "3.12"] | |
| os: [ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| python: "3.10" | |
| - os: macos-latest | |
| python: "3.12" | |
| pip-flags: "--pre" | |
| name: "Python 3.12 (pre-release)" | |
| env: | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: astral-sh/setup-uv@v5 | |
| id: setup-uv | |
| with: | |
| version: "latest" | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| run: "uv sync --extra test" | |
| - name: Test | |
| env: | |
| MPLBACKEND: agg | |
| PLATFORM: ${{ matrix.os }} | |
| DISPLAY: :42 | |
| run: | | |
| uv run pytest --cov --color=yes --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| name: coverage | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |