89 lines (73 loc) · 2.04 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- uses: liskin/gh-problem-matcher-wrap@v1
with:
action: add
linters: flake8
- name: Lint with flake8
shell: bash -l {0}
run: |
pip install flake8
# exit-zero treats all errors as warnings.
flake8 . --ignore=E501 --exit-zero --statistics
- uses: liskin/gh-problem-matcher-wrap@v1
with:
action: remove
linters: flake8
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Conda
uses: actions/cache@v2
env:
# change from default size of 32MB to prevent 503 err
CACHE_UPLOAD_CHUNK_SIZE: 67108864
with:
path: /usr/share/miniconda/envs/lab
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-
- name: Setup Conda dependencies
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: lab
environment-file: environment.yml
python-version: 3.7
auto-activate-base: false
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- uses: liskin/gh-problem-matcher-wrap@v1
with:
action: add
linters: pytest
- name: Run tests
shell: bash -l {0}
run: |
python setup.py test
- uses: liskin/gh-problem-matcher-wrap@v1
with:
action: add
linters: pytest
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}