forked from unit8co/darts
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (145 loc) · 5.71 KB
/
merge.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: darts PR merge workflow
on:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: "Clone repository"
uses: actions/checkout@v4
- name: "Set up Python 3.11"
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: "Install Dev Dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
- name: "Lint"
run: |
pre-commit run --all-files
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, ubuntu-latest]
python-version: ['3.9', '3.11']
flavour: ['core', 'torch', 'all']
steps:
- name: "Clone repository"
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "Setup pip"
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies Flavour ${{ matrix.flavour }}"
run: |
if [ "${{ matrix.flavour }}" == "core" ]; then
pip install -r requirements/core.txt -r requirements/dev.txt
elif [ "${{ matrix.flavour }}" == "torch" ]; then
pip install -r requirements/core.txt -r requirements/torch.txt -r requirements/dev.txt
elif [ "${{ matrix.flavour }}" == "all" ]; then
pip install -r requirements/core.txt -r requirements/torch.txt -r requirements/notorch.txt -r requirements/dev.txt
fi
- name: "Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "Run tests"
run: |
if [ "${{ matrix.flavour }}" == "all" ]; then
pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
else
pytest --durations=50
fi
- name: "Codecov upload"
if: ${{ matrix.flavour == 'all' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
check-examples:
runs-on: ubuntu-latest
strategy:
matrix:
example-name: [00-quickstart.ipynb, 01-multi-time-series-and-covariates.ipynb, 02-data-processing.ipynb, 03-FFT-examples.ipynb, 04-RNN-examples.ipynb, 05-TCN-examples.ipynb, 06-Transformer-examples.ipynb, 07-NBEATS-examples.ipynb, 08-DeepAR-examples.ipynb, 09-DeepTCN-examples.ipynb, 10-Kalman-filter-examples.ipynb, 11-GP-filter-examples.ipynb, 12-Dynamic-Time-Warping-example.ipynb, 13-TFT-examples.ipynb, 15-static-covariates.ipynb, 16-hierarchical-reconciliation.ipynb, 18-TiDE-examples.ipynb, 19-EnsembleModel-examples.ipynb, 20-RegressionModel-examples.ipynb, 21-TSMixer-examples.ipynb, 22-anomaly-detection-examples.ipynb]
steps:
- name: "Clone repository"
uses: actions/checkout@v4
- name: "Set up Python 3.10"
uses: actions/setup-python@v5
with:
python-version: '3.10'
# use `uv` to retrieve the latest dependency versions
- name: "Compile Dependency Versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip compile requirements/dev-all.txt > requirements-latest.txt
# only restore cache but do not upload
- name: "Restore cached python environment"
uses: actions/cache/restore@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
- name: "Setup Pip"
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "Install Locally"
run: |
pip install .
- name: "Run example ${{matrix.example-name}}"
working-directory: ./examples
run: |
papermill ${{matrix.example-name}} ${{matrix.example-name}}
docs:
runs-on: ubuntu-latest
steps:
- name: "Clone repository"
uses: actions/checkout@v4
- name: "Set up Python 3.10"
uses: actions/setup-python@v5
with:
python-version: '3.10'
# use `uv` to retrieve the latest dependency versions
- name: "Compile Dependency Versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip compile requirements/dev-all.txt > requirements-latest.txt
# only restore cache but do not upload
- name: "Restore cached python environment"
uses: actions/cache/restore@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }}
- name: "Install pandoc"
run: |
sudo apt-get install -y pandoc
- name: "Setup Pip"
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "Install Locally"
run: |
pip install .
- name: "Build docs"
run: |
make --directory ./docs build-all-docs