-
Notifications
You must be signed in to change notification settings - Fork 65
51 lines (50 loc) · 1.56 KB
/
main.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
name: Run tests
on: [push]
jobs:
run-tests:
name: Runs on ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: [3.7, 3.8]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('tests/environment.yml') }}
- name: Setup Miniconda using Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: prosail
environment-file: tests/environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Conda Info
run: |
conda info
conda list
- name: Lint
run: |
conda install flake8
python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
python -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Build
run: |
pip install -e .
- name: Run pytest
run: |
conda install pytest
pytest