ci: simplify cashing (#16599)

This commit is contained in:
Jirka Borovec 2023-02-02 19:36:33 +09:00 committed by GitHub
parent de005321a5
commit e4997a27ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 22 deletions

View File

@ -71,8 +71,9 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
restore-keys: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.requires }}-
key: pip-${{ matrix.pkg-name }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
restore-keys: pip-${{ matrix.pkg-name }}-
enableCrossOsArchive: true
- name: Install Lightning package & dependencies
env:

View File

@ -69,8 +69,9 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
restore-keys: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.requires }}-
key: pip-${{ matrix.pkg-name }}-${{ matrix.requires }}-${{ hashFiles('requirements/app/base.txt') }}
restore-keys: pip-${{ matrix.pkg-name }}-
enableCrossOsArchive: true
- name: Switch PyTorch URL
run: python -c "print('TORCH_URL=https://download.pytorch.org/whl/' + str('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html'))" >> $GITHUB_ENV

View File

@ -93,9 +93,9 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/fabric/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-
key: pip-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/fabric/*.txt') }}
restore-keys: pip-${{ matrix.pkg-name }}-${{ matrix.release }}-
enableCrossOsArchive: true
- name: Switch PyTorch URL
run: python -c "print('TORCH_URL=https://download.pytorch.org/whl/' + str('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html'))" >> $GITHUB_ENV

View File

@ -106,9 +106,9 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/pytorch/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-
key: pip-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-${{ hashFiles('requirements/pytorch/*.txt') }}
restore-keys: pip-${{ matrix.pkg-name }}-${{ matrix.release }}-
enableCrossOsArchive: true
- name: Env. variables
run: |

View File

@ -40,9 +40,9 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pytorch/base.txt') }}
restore-keys: |
${{ runner.os }}-pip-
key: pip-${{ hashFiles('requirements/pytorch/base.txt') }}
restore-keys: pip-
enableCrossOsArchive: true
- name: Install dependencies
run: |

View File

@ -60,9 +60,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: |
${{ runner.os }}-docs-test-${{ matrix.pkg-name }}-
key: docs-test-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: docs-test-${{ matrix.pkg-name }}-
- name: Install LAI package
# This is needed as App docs is heavily using/referring to lightning package
@ -125,9 +124,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: |
${{ runner.os }}-docs-make-${{ matrix.pkg-name }}-
key: docs-make-${{ matrix.pkg-name }}-${{ hashFiles('requirements/${{ matrix.pkg-name }}/*.txt') }}
restore-keys: docs-make-${{ matrix.pkg-name }}-
- name: Install package & dependencies
env:

View File

@ -39,9 +39,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-deploy-docs-pip-${{ hashFiles('requirements/app/*.txt') }}
restore-keys: |
${{ runner.os }}-deploy-docs-pip-
key: deploy-docs-pip-${{ hashFiles('requirements/app/*.txt') }}
restore-keys: deploy-docs-pip-
- name: Install package & dependencies
env: