Feat/wrapper model gridsearch #5308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |