[pre-commit.ci] pre-commit autoupdate #585
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- "*" | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
run: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
py_ver: ["3.10", "3.11", "3.12"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.py_ver }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
#### | |
# https://github.com/mamba-org/setup-micromamba/issues/225 | |
micromamba-version: 1.5.10-0 | |
micromamba-binary-path: /home/runner/micromamba-bin-versioned/micromamba | |
#### | |
environment-file: environment.yaml | |
# Added an extra python to the create-args in order to bust the cache: | |
create-args: >- | |
python=${{ matrix.py_ver }} | |
python | |
cache-environment: true | |
- name: Install conda-recipe-manager if possible | |
# Possible when the Python version is >=3.11 | |
run: | | |
if [ $(python -c "import sys; print(sys.version_info[:2] >= (3,11))") = "True" ]; then | |
echo "Installing conda-recipe-manager" | |
micromamba install -y -c conda-forge conda-recipe-manager | |
else | |
echo "Skipping conda-recipe-manager installation" | |
fi | |
- name: Conda info | |
run: | | |
conda info --all | |
conda list | |
- name: Running doctests | |
run: | | |
pytest grayskull \ | |
-vv \ | |
-n 0 \ | |
--color=yes \ | |
--cov=./ \ | |
--cov-append \ | |
--cov-report html:coverage-serial-html \ | |
--cov-report xml:coverage-serial.xml \ | |
--cov-config=.coveragerc \ | |
--junit-xml=Linux-py${{ matrix.py_ver }}-serial.xml \ | |
--junit-prefix=Linux-py${{ matrix.py_ver }}-serial | |
- name: Running serial tests | |
run: | | |
pytest tests \ | |
-vv \ | |
-n 0 \ | |
-m "serial" \ | |
--color=yes \ | |
--cov=./ \ | |
--cov-append \ | |
--cov-report html:coverage-serial-html \ | |
--cov-report xml:coverage-serial.xml \ | |
--cov-config=.coveragerc \ | |
--junit-xml=Linux-py${{ matrix.py_ver }}-serial.xml \ | |
--junit-prefix=Linux-py${{ matrix.py_ver }}-serial | |
- name: Running parallel tests | |
run: | | |
pytest tests \ | |
-vv \ | |
-n 0 \ | |
-m "not serial" \ | |
--color=yes \ | |
--cov=./ \ | |
--cov-append \ | |
--cov-report html:coverage-parallel-html \ | |
--cov-report xml:coverage-parallel.xml \ | |
--cov-config=.coveragerc \ | |
--junit-xml=Linux-py${{ matrix.py_ver }}-parallel.xml \ | |
--junit-prefix=Linux-py${{ matrix.py_ver }}-parallel | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: ./coverage-serial.xml,./coverage-parallel.xml | |
directory: . | |
flags: unittests |