Skip to content

Commit

Permalink
Cache dependencies in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
liammulh committed Apr 25, 2024
1 parent d187934 commit 38e64f1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,28 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install front end and back end dependencies
run: |
npm install
pip install -r requirements.txt
- name: Cache Python dependencies (or restore previously cached)
id: python-cache
uses: actions/cache@v4
with:
path: venv # It's important to have a single directory that gets cached.
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
if: steps.python-cache.outputs.cache-hit != 'true'
run: python -m venv venv && source ./venv/bin/activate && pip install -r requirements.txt
- name: Cache NPM dependencies (or restore previously cached)
id: npm-cache
uses: actions/cache@v4
with:
path: node_modules # It's important to have a single directory that gets cached.
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install
- name: Format the front end and back end code
run: invoke fmt
- name: Lint the front end and back end code
Expand Down

0 comments on commit 38e64f1

Please sign in to comment.