-
Notifications
You must be signed in to change notification settings - Fork 27
120 lines (114 loc) · 3.18 KB
/
pythonpackage.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: NIXPy tests and linting
on:
# Run one build a month at 01:00
# schedule:
# - cron: '0 1 1 * *'
push:
branches:
- master
- dev
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run install
run: |
pip install setuptools
pip install .
- name: Lint with Pylint
run: |
pip install pylint
# Make sure it uses the project rcfile
pylint --rcfile=.pylintrc nixio
- name: Test with pytest
run: |
pip install pytest scipy pillow matplotlib
# pytest will skip cross-compatibility tests since NIX isn't installed
pytest
run-conda-test:
needs: [build]
name: Running tests using miniconda
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10']
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: deptest-${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Show conda details
run: |
conda info
conda list
which python
conda --version
- name: Install Python dependencies
run: |
python setup.py install
pip install pytest scipy pillow matplotlib
- name: Run tests
run: |
pytest
run-coveralls:
needs: [build]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python setup.py install
pip install pytest coveralls scipy pillow matplotlib
- name: Create coverage
run: |
coverage run --source=nixio -m pytest nixio/test/
- name: Submit to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
run-codecov:
needs: [build]
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python setup.py install
pip install pytest pytest-cov scipy pillow matplotlib
- name: Create coverage
run: |
pytest --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v1
with:
name: Submit Codecov coverage
files: ./coverage.xml
verbose: true # optional (default = false)