-
Notifications
You must be signed in to change notification settings - Fork 19
61 lines (60 loc) · 1.87 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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"]
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'}}