Skip to content

Commit

Permalink
CI: Adds cache to node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 committed Mar 14, 2024
1 parent 59b2da6 commit 4ad4ef4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
node-version: 18.12.1
cache: npm
- name: Cache node modules
id: cache-packages
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ hashFiles('package-lock.json') }}
- name: Install
run: npm ci
if: ${{ steps.cache-packages.outputs.cache-hit != 'true' }}
run: npm ci --omit=dev
- name: Build
run: npm run build
- name: Upload artifact
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
- name: Cache node modules
id: cache-packages
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ hashFiles('package-lock.json') }}
- name: Install
run: npm ci
- name: Run tests
Expand Down

0 comments on commit 4ad4ef4

Please sign in to comment.