-
Notifications
You must be signed in to change notification settings - Fork 894
185 lines (150 loc) · 5.36 KB
/
develop.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
178
179
180
181
182
183
184
185
name: darts PR workflow
on:
pull_request:
branches:
- master
jobs:
lint:
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'
- 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.10']
flavour: ['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 }}
# use `uv` to retrieve the latest dependency versions
- name: "Compile Dependency Versions"
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
if [ "${{ matrix.os }}" == "macos-13" ]; then
source $HOME/.local/bin/env
fi
uv pip compile requirements/dev-all.txt > requirements-latest.txt
- name: "Cache python environment"
uses: actions/cache@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: "Run tests"
run: |
pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
- name: "Codecov upload"
if: ${{ matrix.flavour == 'all' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
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
check-examples:
runs-on: ubuntu-latest
strategy:
matrix:
example-name: [03-FFT-examples.ipynb, 04-RNN-examples.ipynb, 00-quickstart.ipynb, 02-data-processing.ipynb, 01-multi-time-series-and-covariates.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}}