Skip to content

Update CI/CD pipelines Part 1 #5246

Update CI/CD pipelines Part 1

Update CI/CD pipelines Part 1 #5246

Workflow file for this run

name: darts PR workflow
on:
pull_request:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: "1. Clone repository"
uses: actions/checkout@v4
- name: "2. Set up Python 3.9"
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: "3. Install Dev Dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements/dev.txt
- name: "4. Lint"
run: |
pre-commit run --all-files
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, ubuntu-latest]
python-version: ['3.9']
flavour: ['all']
steps:
- name: "1. Clone repository"
uses: actions/checkout@v4
- name: "2. Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "3. Cache python environment"
uses: actions/cache@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt') }}
- name: "(No-Cache) Setup Pip"
if: steps.pythonenv-cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
- name: "4. Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "5. Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "6. Run tests"
run: |
pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests
- name: "7. 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: "1. Clone repository"
uses: actions/checkout@v4
- name: "2. Set up Python 3.9"
uses: actions/setup-python@v5
with:
python-version: '3.9'
# only restore cache but do not upload
- name: "3. Restore cached python environment"
uses: actions/cache/restore@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt') }}
- name: "4. Install pandoc"
run: |
sudo apt-get install -y pandoc
- name: "(No-Cache) Setup Pip"
if: steps.pythonenv-cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
- name: "5. Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "6. Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "7. Install Locally"
run: |
pip install .
- name: "8. 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: "1. Clone repository"
uses: actions/checkout@v4
- name: "2. Set up Python 3.9"
uses: actions/setup-python@v5
with:
python-version: '3.9'
# only restore cache but do not upload
- name: "3. Restore cached python environment"
uses: actions/cache/restore@v4
id: pythonenv-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt') }}
- name: "(No-Cache) Setup Pip"
if: steps.pythonenv-cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
- name: "4. Install Dependencies"
run: |
# install latest dependencies (potentially updating cached dependencies)
pip install -U -r requirements/dev-all.txt
- name: "5. Install libomp (for LightGBM)"
run: |
./.github/scripts/libomp-${{ runner.os }}.sh
- name: "6. Install Locally"
run: |
pip install .
- name: "7. Run example ${{matrix.example-name}}"
working-directory: ./examples
run: |
papermill ${{matrix.example-name}} ${{matrix.example-name}}