Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache dependencies on github actions (#1296) #1337

Merged
merged 16 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,27 @@ outputs:
runs:
using: "composite"
steps:
- name: Replace Pipfile if pipfile-version = max
if: inputs.pipfile-version == 'max'
run: |
# Override the current Pipfile with the Pipfile containing the max versions
rm Pipfile
mv tools/packages/pipfiles/Pipfile${{ inputs.python-version }}.max Pipfile

- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: 'pipenv'
cache-dependency-path: '**/Pipfile'

- name: Install pipenv
run: pip install pipenv --upgrade
shell: bash

- name: Install minimum supported dependencies
if: inputs.pipfile-version == 'min'
- name: Install pipenv dependencies
run: pipenv install --dev --python=${{ inputs.python-version }}
shell: bash

- name: Install maximum version supported dependencies
if: inputs.pipfile-version == 'max'
run: |
# Override the current Pipfile with the Pipfile containing the max versions
rm Pipfile
mv tools/packages/pipfiles/Pipfile${{ inputs.python-version }}.max Pipfile
pipenv install --dev --python=${{ inputs.python-version }}
shell: bash

- name: Setup LibMagic (MacOS)
if: inputs.os == 'macos-13' && inputs.install-gui
run: brew install libmagic
Expand All @@ -53,6 +52,11 @@ runs:
if: inputs.install-gui
with:
node-version: 20
cache: 'npm'
cache-dependency-path: |
frontend/taipy/package-lock.json
frontend/taipy-gui/package-lock.json
frontend/taipy-gui/dom/package-lock.json

- name: Frontend Bundle Build
if: inputs.install-gui
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release-single-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/checkout@v4
with:
ssh-key: ${{secrets.DEPLOY_KEY}}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v4
with:
ssh-key: ${{secrets.DEPLOY_KEY}}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/setup-node@v4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: |
frontend/taipy/package-lock.json
frontend/taipy-gui/package-lock.json
frontend/taipy-gui/dom/package-lock.json

- name: Install dom dependencies
working-directory: ./frontend/taipy-gui/dom
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/partial-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: 'pipenv'
cache-dependency-path: '**/Pipfile'
- name: Install Setuptools and wheel
run: pip install --upgrade setuptools wheel

Expand All @@ -64,9 +66,17 @@ jobs:
if: matrix.os == 'macos-13'
run: brew install libmagic

- uses: actions/setup-node@v4
- name: Setup Node
if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
dinhlongviolin1 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: |
frontend/taipy/package-lock.json
frontend/taipy-gui/package-lock.json
frontend/taipy-gui/dom/package-lock.json

- name: Frontend Bundle Build
if: steps.changes.outputs.gui == 'true' || steps.changes.outputs.gui-core == 'true'
run: pipenv run python tools/frontend/bundle_build.py
Expand Down Expand Up @@ -128,7 +138,17 @@ jobs:
core:
- 'taipy/core/**'

- uses: actions/setup-python@v5
- name: Setup Python with cache
if: steps.changes.outputs.core == 'true'
dinhlongviolin1 marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: 'pipenv'
cache-dependency-path: '**/Pipfile'

- name: Setup Python without cache
if: steps.changes.outputs.core != 'true'
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
dinhlongviolin1 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -167,7 +187,17 @@ jobs:
core:
- 'taipy/core/**'

- uses: actions/setup-python@v5
- name: Setup Python with cache
if: steps.changes.outputs.core == 'true'
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: 'pipenv'
cache-dependency-path: '**/Pipfile'

- name: Setup Python without cache
if: steps.changes.outputs.core != 'true'
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
dinhlongviolin1 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}

Expand Down
Loading