Skip to content

Commit

Permalink
ci: add cache npm
Browse files Browse the repository at this point in the history
  • Loading branch information
trigoporres committed Nov 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 786c881 commit ec9e7fe
Showing 1 changed file with 52 additions and 10 deletions.
62 changes: 52 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -22,10 +22,25 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/setup-node

- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
node_modules
~/.npm
**/dist
key: ${{ runner.os }}-prepare-${{ env.cache-name }}-${{ github.sha }}
- name: Set Node v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Generate dist
run: npm run build

@@ -38,8 +53,17 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/setup-node
- name: Use node modules cache
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
node_modules
~/.npm
**/dist
key: ${{ runner.os }}-prepare-${{ env.cache-name }}-${{ github.sha }}

- name: Run linter
run: npm run lint
@@ -52,8 +76,17 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/setup-node
- name: Use node modules cache
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
node_modules
~/.npm
**/dist
key: ${{ runner.os }}-prepare-${{ env.cache-name }}-${{ github.sha }}

- name: Run unit tests
run: npm run test:ci
@@ -75,8 +108,17 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Node.js ⚙️ - Cache dependencies ⚡ - Install dependencies 🔧
uses: ./.github/workflows/setup-node
- name: Use node modules cache
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
node_modules
~/.npm
**/dist
key: ${{ runner.os }}-prepare-${{ env.cache-name }}-${{ github.sha }}

- name: Run dependency cruiser
run: npm run depcruise

0 comments on commit ec9e7fe

Please sign in to comment.