Skip to content

Commit

Permalink
Use caching for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iZooGooD committed Jan 16, 2024
1 parent 6b214b7 commit cc57e57
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
Expand All @@ -29,6 +37,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
Expand All @@ -38,8 +54,7 @@ jobs:
- run: npm ci

- name: Check code formatting with Prettier
run: |
npx prettier --check "src/**/*.{js,jsx,ts,tsx,json,css,md}"
run: npx prettier --check "src/**/*.{js,jsx,ts,tsx,json,css,md}"

test:
name: Run tests
Expand All @@ -48,6 +63,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
Expand All @@ -57,4 +80,3 @@ jobs:
- run: npm ci

- run: npm test

0 comments on commit cc57e57

Please sign in to comment.