Update for new python, pandas, and sklearn versions #126
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
# This workflow will setup conda environment, lint the code, run test suite, ensure docs can be built and upload code coverage | |
# Extracted from https://gist.github.com/mwouts/9842452d020c08faf9e84a3bba38a66f | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v1 | |
with: | |
path: ~/conda_pkgs_dir | |
key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }} | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
auto-activate-base: false | |
activate-environment: hcrystalball | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
use-only-tar-bz2: true | |
- name: Lint with flake8 | |
shell: pwsh | |
run: flake8 . | |
- name: Install from source | |
# This is required for the pre-commit tests | |
shell: pwsh | |
run: pip install . | |
- name: Conda list | |
shell: pwsh | |
run: conda list | |
- name: Test with pytest | |
shell: pwsh | |
run: | | |
if("${{ matrix.os }}" -eq "windows-latest"){ | |
pytest --no-cov | |
} else { | |
pytest --cov=./ --cov-report=xml | |
} | |
- name: Build docs | |
shell: pwsh | |
run: python setup.py build_sphinx | |
if: ${{ matrix.os != 'windows-latest'}} | |
- name: Upload coverage | |
uses: codecov/codecov-action@v1 | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version=='3.8'}} |