Skip to content

Commit

Permalink
Update cache workflow in Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
akazakou committed Jul 2, 2024
1 parent bdc7fbb commit 4555ba1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Checkout source code
uses: actions/checkout@v4

- name: Restore cache of Node.js project dependencies
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: node_modules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install Node.js project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Compile sources to "./compiled" directory
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,17 @@ jobs:
name: Verifying
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Checkout source code
uses: actions/checkout@v4

- name: Restore cache of Node.js project dependencies
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: node_modules
- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
node-version: '20'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install Node.js project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Run lint of code
Expand Down

0 comments on commit 4555ba1

Please sign in to comment.