Skip to content

Commit

Permalink
[GitHub Actions] Use actions/setup-python to cache dependencies
Browse files Browse the repository at this point in the history
In place of directly using actions/cache
Now that actions/setup-python supports caching dependencies with actions/setup-python#266 in v2.3.0
  • Loading branch information
Harmon758 committed Oct 21, 2023
1 parent 4c2af44 commit 4ceffea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 49 deletions.
30 changes: 2 additions & 28 deletions .github/workflows/platforms.yml
Expand Up @@ -29,13 +29,7 @@ jobs:
with:
python-version-file: pyproject.toml
architecture: x64
- name: Cache pip
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -64,27 +58,7 @@ jobs:
with:
python-version-file: pyproject.toml
architecture: x64
- uses: actions/cache@v3.3.2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v3.3.2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v3.3.2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
24 changes: 3 additions & 21 deletions .github/workflows/tests.yml
Expand Up @@ -13,13 +13,7 @@ jobs:
with:
python-version-file: pyproject.toml
architecture: x64
- name: Cache pip
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -37,13 +31,7 @@ jobs:
with:
python-version-file: pyproject.toml
architecture: x64
- name: Cache pip
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -61,13 +49,7 @@ jobs:
with:
python-version-file: pyproject.toml
architecture: x64
- name: Cache pip
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down

0 comments on commit 4ceffea

Please sign in to comment.