Skip to content

Commit

Permalink
Use ID to correctly skip unnecessary steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Trudeau committed Oct 17, 2024
1 parent 67ddbc5 commit 13d4f37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cache_venv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
#----------------------------------------------
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
id: restore-cache
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev_requirements.txt') }}
path: .venv
Expand All @@ -37,7 +38,7 @@ jobs:
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-cache.outputs.cache-hit != 'true'
run: |
python -m venv .venv
source .venv/bin/activate
Expand All @@ -49,7 +50,7 @@ jobs:
# save venv to cache
#----------------------------------------------
- name: Saved cached virtualenv
if: steps.cache.outputs.cache-hit != 'true'
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev_requirements.txt') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Run Isort
#----------------------------------------------
isort:
name: isort
name: Isort
needs: venv-setup
uses: ./.github/workflows/cache_venv.yml
with:
Expand Down

0 comments on commit 13d4f37

Please sign in to comment.