-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (54 loc) · 1.59 KB
/
test.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
name: "Test"
on:
push:
branches: [master,github-actions-test]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
- '.gitignore'
- 'setup.py'
pull_request:
branches: [master]
paths-ignore:
- 'README.md'
- '.deepsource.toml'
- '.gitignore'
- 'setup.py'
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [3.7,3.8,3.9]
test-folder : ['tests']
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build using Python ${{matrix.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
- name: cache conda
uses: actions/cache@v1
with:
path: $CONDA
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
restore-keys: |
${{ runner.os }}-conda-
- name: install dependencies [conda]
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda env update --file environment.yml --name base
$CONDA/bin/pip install -e .
- name: unit testing [pytest]
env:
TEST_TOKEN: ${{ secrets.TEST_TOKEN }}
run: |
$CONDA/bin/pytest --cov-report term --cov-report xml:coverage.xml --cov=ioSPI ${{matrix.test-folder}}
- name: uploading code coverage [codecov]
if: ${{matrix.python-version == 3.7}}
run: |
bash <(curl -s https://codecov.io/bash) -c