Merge pull request #68 from axiom-data-science/dependabot/github_acti… #325
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, pull_request] | |
jobs: | |
build: | |
name: Build (${{ matrix.python-version }} | ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
# - name: Cache conda | |
# uses: actions/cache@v3 | |
# env: | |
# # Increase this value to reset cache if ci/environment.yml has not changed | |
# CACHE_NUMBER: 0 | |
# with: | |
# path: ~/conda_pkgs_dir | |
# key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }} | |
- name: Setup Linux/macOS Micromamba Python ${{ matrix.python-version }} | |
if: ${{ runner.os != 'Windows' }} | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
init-shell: bash | |
create-args: >- | |
python=${{ matrix.python-version }} --channel conda-forge | |
environment-file: ci/environment-py${{ matrix.python-version }}.yml | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Setup Windows Micromamba Python ${{ matrix.python-version }} | |
if: ${{ runner.os == 'Windows' }} | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
init-shell: bash | |
create-args: >- | |
python=${{ matrix.python-version }} --channel conda-forge | |
environment-file: ci/environment-py${{ matrix.python-version }}-win.yml | |
cache-environment: true | |
post-cleanup: 'all' | |
# - name: Setup Micromamba Python ${{ matrix.python-version }} | |
# uses: mamba-org/setup-micromamba@v2 | |
# with: | |
# init-shell: bash | |
# create-args: >- | |
# python=${{ matrix.python-version }} --channel conda-forge | |
# environment-file: ci/environment-py${{ matrix.python-version }}.yml | |
# cache-environment: true | |
# post-cleanup: 'all' | |
# - name: Set up conda environment | |
# uses: conda-incubator/setup-miniconda@v2 | |
# with: | |
# # mamba-version: "*" # activate this to build with mamba. | |
# python-version: ${{ matrix.python-version }} | |
# miniforge-variant: Mambaforge | |
# use-mamba: true | |
# channels: conda-forge, defaults # These need to be specified to use mamba | |
# channel-priority: true | |
# environment-file: ci/environment-py${{ matrix.python-version }}.yml | |
# activate-environment: test_env_model_assessor | |
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Install package | |
shell: bash -l {0} | |
run: | | |
python -m pip install -e . --no-deps --force-reinstall | |
- name: Run Tests | |
shell: bash -l {0} | |
run: | | |
pytest --mpl --cov=./ --cov-report=xml | |
- name: Upload code coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false |