Skip to content

Commit

Permalink
Cache dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Paupiera committed Jan 9, 2024
1 parent dcd7e37 commit d27813a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, maxos-latest]
python-version: 3.11
pytorch-version: 1.12.0

steps:
- name: Checkout
Expand All @@ -18,7 +23,20 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.11
cache: 'pip'

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.os }}-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ matrix.os }}-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down

0 comments on commit d27813a

Please sign in to comment.