| 1 |
name: NIXPy tests and linting |
| 2 |
|
| 3 |
on: |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
push: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
- dev |
| 11 |
pull_request: |
| 12 |
branches: |
| 13 |
- master |
| 14 |
|
| 15 |
jobs: |
| 16 |
build: |
| 17 |
runs-on: ${{ matrix.os }} |
| 18 |
strategy: |
| 19 |
max-parallel: 4 |
| 20 |
matrix: |
| 21 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 22 |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] |
| 23 |
|
| 24 |
steps: |
| 25 |
- uses: actions/checkout@v2 |
| 26 |
- name: Set up Python ${{ matrix.python-version }} |
| 27 |
uses: actions/setup-python@v2 |
| 28 |
with: |
| 29 |
python-version: ${{ matrix.python-version }} |
| 30 |
- name: Run install |
| 31 |
run: | |
| 32 |
pip install setuptools |
| 33 |
pip install . |
| 34 |
- name: Lint with Pylint |
| 35 |
run: | |
| 36 |
pip install pylint |
| 37 |
# Make sure it uses the project rcfile |
| 38 |
pylint --rcfile=.pylintrc nixio |
| 39 |
- name: Test with pytest |
| 40 |
run: | |
| 41 |
pip install pytest scipy pillow matplotlib |
| 42 |
# pytest will skip cross-compatibility tests since NIX isn't installed |
| 43 |
pytest |
| 44 |
|
| 45 |
run-conda-test: |
| 46 |
needs: [build] |
| 47 |
name: Running tests using miniconda |
| 48 |
runs-on: ${{ matrix.os }} |
| 49 |
defaults: |
| 50 |
run: |
| 51 |
shell: bash -l {0} |
| 52 |
strategy: |
| 53 |
max-parallel: 4 |
| 54 |
matrix: |
| 55 |
os: [ubuntu-latest, macos-latest, windows-latest] |
| 56 |
python-version: ['3.10'] |
| 57 |
steps: |
| 58 |
- uses: actions/checkout@v2 |
| 59 |
- uses: conda-incubator/setup-miniconda@v2 |
| 60 |
with: |
| 61 |
miniconda-version: "latest" |
| 62 |
activate-environment: deptest-${{ matrix.python-version }} |
| 63 |
python-version: ${{ matrix.python-version }} |
| 64 |
channels: conda-forge |
| 65 |
- name: Show conda details |
| 66 |
run: | |
| 67 |
conda info |
| 68 |
conda list |
| 69 |
which python |
| 70 |
conda --version |
| 71 |
- name: Install Python dependencies |
| 72 |
run: | |
| 73 |
python setup.py install |
| 74 |
pip install pytest scipy pillow matplotlib |
| 75 |
- name: Run tests |
| 76 |
run: | |
| 77 |
pytest |
| 78 |
|
| 79 |
run-coveralls: |
| 80 |
needs: [build] |
| 81 |
runs-on: [ubuntu-latest] |
| 82 |
steps: |
| 83 |
- uses: actions/checkout@v2 |
| 84 |
- name: Setup Python 3.10 |
| 85 |
uses: actions/setup-python@v2 |
| 86 |
with: |
| 87 |
python-version: "3.10" |
| 88 |
- name: Install dependencies |
| 89 |
run: | |
| 90 |
python setup.py install |
| 91 |
pip install pytest coveralls scipy pillow matplotlib |
| 92 |
- name: Create coverage |
| 93 |
run: | |
| 94 |
coverage run --source=nixio -m pytest nixio/test/ |
| 95 |
- name: Submit to coveralls |
| 96 |
env: |
| 97 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 98 |
run: coveralls --service=github |
| 99 |
|
| 100 |
run-codecov: |
| 101 |
needs: [build] |
| 102 |
runs-on: [ubuntu-latest] |
| 103 |
steps: |
| 104 |
- uses: actions/checkout@v2 |
| 105 |
- name: Setup Python 3.10 |
| 106 |
uses: actions/setup-python@v2 |
| 107 |
with: |
| 108 |
python-version: "3.10" |
| 109 |
- name: Install dependencies |
| 110 |
run: | |
| 111 |
python setup.py install |
| 112 |
pip install pytest pytest-cov scipy pillow matplotlib |
| 113 |
- name: Create coverage |
| 114 |
run: | |
| 115 |
pytest --cov=./ --cov-report=xml |
| 116 |
- uses: codecov/codecov-action@v1 |
| 117 |
with: |
| 118 |
name: Submit Codecov coverage |
| 119 |
files: ./coverage.xml |
| 120 |
verbose: true |