Update infrastructure (#23) #160
This file contains 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: main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
# Automatically cancel a previous run. | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
run-tests: | |
name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-13 # intel | |
- macos-latest # arm | |
- windows-latest | |
environment: | |
- py310 | |
- py311 | |
- py312 | |
- py313 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: prefix-dev/setup-pixi@v0.8.2 | |
with: | |
pixi-version: v0.41.1 | |
cache: true | |
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
frozen: true | |
environments: ${{ matrix.environment }} | |
- name: Run all tests except Linux and py313. | |
if: runner.os != 'Linux' || matrix.environment != 'py313' | |
shell: bash -el {0} | |
run: pixi run -e ${{ matrix.environment }} tests | |
- name: Run tests with codecov on Linux and py313. | |
if: runner.os == 'Linux' && matrix.environment == 'py313' | |
shell: bash -el {0} | |
run: pixi run -e ${{ matrix.environment }} tests-with-cov | |
- name: Upload coverage report. | |
if: runner.os == 'Linux' && matrix.environment == 'py313' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |