Skip to content

update workflow environments #96

update workflow environments

update workflow environments #96

Workflow file for this run

name: test
on:
push:
branches:
- 'main'
paths:
- '**.py'
- '.github/workflows/test*.yml'
- 'pyproject.toml'
pull_request:
paths:
- '**.py'
- '.github/workflows/test*.yml'
- 'pyproject.toml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: mamba-org/setup-micromamba@v1
with:
condarc: |
channels:
- conda-forge
environment-name: style
create-args: >-
ruff
cache-downloads: true
cache-environment: true
init-shell: >-
bash
- uses: actions/checkout@v4
- run: ruff check .
test:
name: test Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python: [ '3.9', '3.10' ]
steps:
- uses: mamba-org/setup-micromamba@v1
with:
condarc: |
channels:
- conda-forge
environment-name: test
create-args: >-
python=${{ matrix.python }}
pytest-xdist
cache-downloads: true
cache-environment: true
init-shell: >-
bash
- uses: actions/checkout@v4
- run: pip install ".[test]"
- run: pytest -n auto
test_with_coverage:
name: test with code coverage
runs-on: ubuntu-latest
steps:
- uses: mamba-org/setup-micromamba@v1
with:
condarc: |
channels:
- conda-forge
environment-name: coverage
create-args: >-
python=${{ matrix.python }}
pytest-xdist
pytest-cov
cache-downloads: true
cache-environment: true
init-shell: >-
bash
- uses: actions/checkout@v4
- run: pip install ".[test]"
- run: pytest --cov . --cov-report xml:coverage.xml --cov-report term-missing -n auto
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false