CI #434
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: CI | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
schedule: | |
# Nightly tests run on main by default | |
- cron: "0 0 * * *" | |
jobs: | |
test: | |
name: Tests on ${{ matrix.os }} ${{matrix.conda}} 🐍 ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.9] | |
conda: ['micromamba', 'mamba', 'conda'] | |
include: | |
- os: 'macos-latest' | |
conda: 'micromamba' | |
python-version: 3.9 | |
- os: 'windows-latest' | |
conda: 'micromamba' | |
python-version: 3.9 | |
steps: | |
- uses: actions/checkout@v1 | |
# Install conda/mamba/micromamba, but do not activate; we want to install with non-conda Python | |
- if: matrix.conda == 'conda' | |
name: Install Conda | |
uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda | |
with: | |
environment-file: devtools/conda-envs/pip_env.yml | |
miniforge-variant: "Miniforge3" | |
activate-environment: '' | |
auto-update-conda: false | |
auto-activate-base: false | |
- if: matrix.conda == 'mamba' | |
name: Install Mamba | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
environment-file: devtools/conda-envs/pip_env.yml | |
miniforge-variant: "Mambaforge" | |
activate-environment: '' | |
auto-update-conda: false | |
auto-activate-base: false | |
- if: matrix.conda == 'micromamba' | |
name: Install Micromamba | |
uses: mamba-org/setup-micromamba@v1 # https://github.com/mamba-org/setup-micromamba | |
with: | |
environment-file: devtools/conda-envs/pip_env.yml | |
init-shell: >- | |
bash | |
powershell | |
- name: Get conda/mamba/micromamba info | |
shell: bash -l {0} | |
run: | | |
${{ matrix.conda }} --help | |
${{ matrix.conda }} create --help | |
${{ matrix.conda }} run --help | |
${{ matrix.conda }} env create --help | |
# Install non-conda Python | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install package | |
shell: bash -l {0} | |
run: | | |
python -m pip install .[test] | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
pytest -v --cov=soap --cov-report=xml --color=yes soap/tests/ | |
- name: Run tests with SOAP | |
shell: bash -l {0} | |
run: | | |
soap test | |
- name: CodeCov | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |