diff --git a/.github/scripts/flavor_requirements.sh b/.github/scripts/flavor_requirements.sh deleted file mode 100755 index ca916d098d..0000000000 --- a/.github/scripts/flavor_requirements.sh +++ /dev/null @@ -1 +0,0 @@ -exit 0 diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index cc951687c2..834c1a1026 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -9,20 +9,20 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" + - name: "Set up Python 3.9" uses: actions/setup-python@v5 with: python-version: '3.9' - - name: "3. Install Dev Dependencies" + - name: "Install Dev Dependencies" run: | python -m pip install --upgrade pip pip install -r requirements/dev.txt - - name: "4. Lint" + - name: "Lint" run: | pre-commit run --all-files @@ -36,40 +36,39 @@ jobs: flavour: ['all'] steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python ${{ matrix.python-version }}" + - name: "Set up Python ${{ matrix.python-version }}" uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: "3. Cache python environment" + - name: "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' + - name: "Setup Pip" run: | python -m pip install --upgrade pip - - name: "4. Install Dependencies" + - name: "Install Dependencies" run: | # install latest dependencies (potentially updating cached dependencies) pip install -U -r requirements/dev-all.txt - - name: "5. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "6. Run tests" + - name: "Run tests" run: | pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests - - name: "7. Codecov upload" + - name: "Codecov upload" if: ${{ matrix.flavour == 'all' }} uses: codecov/codecov-action@v4 with: @@ -79,45 +78,44 @@ jobs: docs: runs-on: ubuntu-latest steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" + - name: "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" + - 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') }} - - name: "4. Install pandoc" + - name: "Install pandoc" run: | sudo apt-get install -y pandoc - - name: "(No-Cache) Setup Pip" - if: steps.pythonenv-cache.outputs.cache-hit != 'true' + - name: "Setup Pip" run: | python -m pip install --upgrade pip - - name: "5. Install Dependencies" + - name: "Install Dependencies" run: | # install latest dependencies (potentially updating cached dependencies) pip install -U -r requirements/dev-all.txt - - name: "6. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "7. Install Locally" + - name: "Install Locally" run: | pip install . - - name: "8. Build docs" + - name: "Build docs" run: | make --directory ./docs build-all-docs @@ -127,41 +125,40 @@ jobs: 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" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" + - name: "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" + - 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') }} - - name: "(No-Cache) Setup Pip" - if: steps.pythonenv-cache.outputs.cache-hit != 'true' + - name: "Setup Pip" run: | python -m pip install --upgrade pip - - name: "4. Install Dependencies" + - name: "Install Dependencies" run: | # install latest dependencies (potentially updating cached dependencies) pip install -U -r requirements/dev-all.txt - - name: "5. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "6. Install Locally" + - name: "Install Locally" run: | pip install . - - name: "7. Run example ${{matrix.example-name}}" + - name: "Run example ${{matrix.example-name}}" working-directory: ./examples run: | papermill ${{matrix.example-name}} ${{matrix.example-name}} diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 58db19465a..41cf87f7a7 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -9,20 +9,20 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.10" + - name: "Set up Python 3.10" uses: actions/setup-python@v5 with: python-version: '3.10' - - name: "3. Install Dev Dependencies" + - name: "Install Dev Dependencies" run: | python -m pip install --upgrade pip pip install -r requirements/dev.txt - - name: "4. Lint" + - name: "Lint" run: | pre-commit run --all-files @@ -35,19 +35,19 @@ jobs: flavour: ['core', 'torch', 'all'] steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python ${{ matrix.python-version }}" + - name: "Set up Python ${{ matrix.python-version }}" uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: "3. Setup pip" + - name: "Setup pip" run: | python -m pip install --upgrade pip - - name: "4. Install `flavor=${{ matrix.flavor }}` Dependencies" + - name: "Install `flavor=${{ matrix.flavor }}` Dependencies" run: | if [ "${{ matrix.flavor }}" == "core" ]; then pip install -r requirements/core.txt -r requirements/dev.txt @@ -57,18 +57,18 @@ jobs: pip install -r requirements/dev-all.txt fi - - name: "5. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "6. Run tests" + - name: "Run tests" run: | if [ "${{ matrix.flavor }}" == "all" ]; then pytest --durations=50 --cov=darts --cov-config=.coveragerc --cov-report=xml darts/tests else pytest --durations=50 - - name: "7. Codecov upload" + - name: "Codecov upload" if: ${{ matrix.flavour == 'all' }} uses: codecov/codecov-action@v4 with: @@ -81,41 +81,40 @@ jobs: 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: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" + - name: "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" + - 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') }} - - name: "(No-Cache) Setup Pip" - if: steps.pythonenv-cache.outputs.cache-hit != 'true' + - name: "Setup Pip" run: | python -m pip install --upgrade pip - - name: "4. Install Dependencies" + - name: "Install Dependencies" run: | # install latest dependencies (potentially updating cached dependencies) pip install -U -r requirements/dev-all.txt - - name: "5. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "6. Install Locally" + - name: "Install Locally" run: | pip install . - - name: "7. Run example ${{matrix.example-name}}" + - name: "Run example ${{matrix.example-name}}" working-directory: ./examples run: | papermill ${{matrix.example-name}} ${{matrix.example-name}} @@ -123,44 +122,43 @@ jobs: docs: runs-on: ubuntu-latest steps: - - name: "1. Clone repository" + - name: "Clone repository" uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" + - name: "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" + - 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') }} - - name: "4. Install pandoc" + - name: "Install pandoc" run: | sudo apt-get install -y pandoc - - name: "(No-Cache) Setup Pip" - if: steps.pythonenv-cache.outputs.cache-hit != 'true' + - name: "Setup Pip" run: | python -m pip install --upgrade pip - - name: "5. Install Dependencies" + - name: "Install Dependencies" run: | # install latest dependencies (potentially updating cached dependencies) pip install -U -r requirements/dev-all.txt - - name: "6. Install libomp (for LightGBM)" + - name: "Install libomp (for LightGBM)" run: | ./.github/scripts/libomp-${{ runner.os }}.sh - - name: "7. Install Locally" + - name: "Install Locally" run: | pip install . - - name: "8. Build docs" + - name: "Build docs" run: | make --directory ./docs build-all-docs diff --git a/.github/workflows/update-cache.yml b/.github/workflows/update-cache.yml new file mode 100644 index 0000000000..e6cfa2cace --- /dev/null +++ b/.github/workflows/update-cache.yml @@ -0,0 +1,41 @@ +name: update-cache + +on: + push: + branches: + - master + +jobs: + # This workflow updates the python environment cache so that other workflows in different branches have access to it + build-cache: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-13, ubuntu-latest] + python-version: ['3.9'] + 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 }} + + - name: "Cache python environment" + uses: actions/cache@v4 + id: pythonenv-cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt') }} + + - name: "Setup Pip" + run: | + python -m pip install --upgrade pip + + - name: "Install Latest Dependencies" + run: | + # install latest dependencies (potentially updating cached dependencies) + pip install -U -r requirements/dev-all.txt