Skip to content

Commit

Permalink
merge cache pip of linux and macOS using matrix.path in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentDS committed Jul 18, 2021
1 parent b7e381d commit 0a5730e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ jobs:
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8 ]
torch-version: [1.7.1, 1.8.1]
torch-version: [1.7.1, 1.8.0]
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip

steps:
- uses: actions/checkout@v2
Expand All @@ -22,23 +27,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip Linux
- name: Cache pip
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip macOS
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
# This path is specific to macOS
path: ~/Library/Caches/pip
# This path is depend on os
path: ${{ matrix.path }}
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy
torch==1.7.1
torchvision==0.8.2
torchvision>=0.8.2

0 comments on commit 0a5730e

Please sign in to comment.