forked from vanderschaarlab/temporai
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 2.81 KB
/
test_full.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
name: "Tests: Full"
on:
schedule:
- cron: "17 4 * * 3"
workflow_dispatch:
jobs:
# Lint code with pre-commit.
Linter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
os: [ubuntu-latest]
env:
CODECOV_OS: ${{ matrix.os }}
CODECOV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit validation
run: pre-commit run --all-files
# Run tests with pytest.
Tests:
needs: [Linter]
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # Caching pip dependencies.
- name: Install dependencies
run: |
pip install --upgrade pip
pip install .[dev]
- name: Test with pytest (xdist)
if: matrix.os != 'ubuntu-latest'
run: pytest -vvvx -n auto -m "not skipci" --durations=50 --cov
- name: Test with pytest
# Avoid xdist on 'ubuntu-latest', as this has worse performance.
if: matrix.os == 'ubuntu-latest'
run: pytest -vvvx -m "not skipci" --durations=50 --cov
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
# Currently we only upload in one of the matrix cases: ubuntu + py38:
if: (matrix.os == 'ubuntu-latest') && (matrix.python-version == '3.8')
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: test_full # {test,test_full}
env_vars: CODECOV_OS,CODECOV_PYTHON
name: upload_test_full_${{ matrix.os }}_python${{ matrix.python-version }}
fail_ci_if_error: false # Whether CI fails if this step fails.
os: ${{ runner.os }}
verbose: true
- name: Run doctests with pytest (xdist)
if: matrix.os != 'ubuntu-latest'
run: pytest -vvvx -n auto src/ --doctest-modules --durations=50
- name: Run doctests with pytest
# Avoid xdist on 'ubuntu-latest', as this has worse performance.
if: matrix.os == 'ubuntu-latest'
run: pytest -vvvx src/ --doctest-modules --durations=50
- name: Test notebooks run without error
run: python tests/nb_eval.py --nb_dir ./