Skip to content

Commit

Permalink
feat: cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sravan-s committed Mar 31, 2023
1 parent cfd2907 commit 8f9c82d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/coverage.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Caching with npm
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v3

- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
node-version: ${{ matrix.node-version }}
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list

- name: Install dependencies
run: npm install

- name: Test
run: npm test
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"node": "16.x"
},
"scripts": {
"test": "jest",
"test": "jest --coverage",
"test-update-snapshot": "jest -u",
"coverage": "jest --coverage",
"afterbuild": "node ./scripts/post_build.js;",
"cp-css": "./scripts/copy-css.sh",
"clean-release": "rm -rf ./release; rm -rf ./dist",
Expand Down

0 comments on commit 8f9c82d

Please sign in to comment.