-
Notifications
You must be signed in to change notification settings - Fork 125
97 lines (87 loc) · 2.41 KB
/
tests.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
90
91
92
93
94
95
96
97
---
name: Test
on:
pull_request:
push:
branches:
- master
- dev1
- "!gh-pages"
env:
IS_CI: 'true'
jobs:
bundled:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.9', '3.10', '3.11']
jobtype: ['test']
include:
- os: 'ubuntu-latest'
python-version: '3.10'
jobtype: 'lint'
- os: 'ubuntu-latest'
python-version: '3.10'
jobtype: 'coverage'
- os: 'macos-latest'
python-version: '3.10'
jobtype: 'test'
env:
JOBTYPE: ${{ matrix.jobtype }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'setup.py'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install coveralls
- name: Run tests
run: |
if [[ "$JOBTYPE" == "lint" ]]; then
# Run flake8 via pre-commit instead.
#- flake8 . # Use --exit-zero to ignore failure
pre-commit install
pre-commit run --all-files
elif [[ "$JOBTYPE" == "coverage" ]]; then
pytest tests --ignore=dapper/mods/QG --cov=dapper --cov-report term-missing
else
pytest tests
fi
- name: Publish coverage to coveralls.io
if: ${{ env.JOBTYPE == 'coverage' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
conda:
defaults:
run:
shell: bash -el {0}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.9', '3.10', '3.11']
include:
- os: 'macos-latest'
python-version: '3.10'
- os: 'windows-latest'
python-version: '3.9'
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[dev]
- name: Run tests
run: |
which python
pytest tests