-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (70 loc) · 2.15 KB
/
run-tox.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
name: Run all tox jobs using Python3
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
min_versions: ["min_versions", "latest_versions"]
exclude:
- min_versions: "min_versions"
include:
- python-version: "3.8"
min_versions: "min_versions"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache tox and precommit environments
uses: actions/cache@v3
with:
path: |
.tox
~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}-${{ hashFiles('setup.py') }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Clear results in tox environments
run: |
rm -rf .tox/*/tmp
- name: Run tox with latest versions
if: ${{ matrix.min_versions == 'latest_versions' }}
run: |
python -m pip install --upgrade pip setuptools
pip install tox-gh-actions
tox
- name: Run tox with min versions
if: ${{ matrix.min_versions == 'min_versions' }}
run: |
python -m pip install --upgrade pip setuptools
pip install tox
tox run -e min_versions
- name: JUnit Report Action
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'reports/pytest-*.xml'
- name: Upload to codecov
if: ${{matrix.python-version == '3.9'}}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: pytest
name: "NeuroTS-py${{ matrix.python-version }}"
- name: Upload test artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: tests-${{ matrix.python-version }}
retention-days: 4
path: |
.tox/py*/tmp
docs/build
reports