-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (96 loc) · 3.71 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [develop, master]
pull_request:
branches: [develop]
jobs:
# Define matrix build for multiple test scenarios
test:
runs-on: ubuntu-latest
strategy:
matrix:
# py_backwardscompat is not included because there is also an issue with numpy compatibility on Python 3.10
env_name: [py_pinned_dependencies, py_latest_dependencies]
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
lfs: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [[ "${{ matrix.env_name }}" == "py_pinned_dependencies" ]]; then
pip install -v \
-r requirements.txt \
-r requirements_torch.txt \
-r requirements_lightgbm.txt \
-r requirements_geoanalytics.txt \
-r requirements_xgboost.txt \
pytest \
pytest-cov \
pytest-xdist \
pytorch-lightning~=1.1.0 \
coverage \
coverage-badge
elif [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
pip install \
pytest \
jupyter==1.0.0 \
nbconvert==6.5.0 \
clearml==0.17.1 \
"pytorch-lightning>=1.1" \
".[full]"
elif [[ "${{ matrix.env_name }}" == "py_backwardscompat" ]]; then
pip install \
pytest \
"scikit-learn==1.0.2" \
"numpy<1.21" \
".[torch]"
fi
pip install --no-deps -e .
- name: Run Tests
run: |
if [[ "${{ matrix.env_name }}" == "py_pinned_dependencies" ]]; then
coverage erase
pytest -n 4 --cov --cov-append --cov-report=term-missing tests;
coverage html
coverage-badge -o badges/coverage.svg -f
elif [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
pytest
elif [[ "${{ matrix.env_name }}" == "py_backwardscompat" ]]; then
pytest tests/backwardscompat;
fi
- name: Run Notebook Tests
run: |
if [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
pytest notebooks;
fi
# Documentation build job
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Documentation Dependencies
run: |
python -m pip install --upgrade pip
pip install \
sphinx==5.0.2 \
sphinxcontrib-websupport==1.2.4 \
sphinx-toolbox==3.7.0 \
sphinx_rtd_theme \
nbsphinx \
ipython \
ipywidgets \
jupyter-book==0.15.1
- name: Build Documentation
run: sh build-docs.sh