Skip to content

Commit 45f4e65

Browse files
committed
feat(ci): added node_modules cache in github actions
1 parent b962765 commit 45f4e65

File tree

4 files changed

+87
-3
lines changed

4 files changed

+87
-3
lines changed

.github/workflows/ci.js.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ jobs:
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
cache: "npm"
26+
- name: Api node_modules cache
27+
id: api-node_modules-cache
28+
uses: actions/cache@v4
29+
with:
30+
path: ./packages/reva-api/node_modules
31+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
2632
- name: Installing dependencies
33+
if: steps.api-node_modules-cache.outputs.cache-hit != 'true'
2734
run: npm ci
2835
- name: Building
2936
run: npm run build --if-present
@@ -43,7 +50,14 @@ jobs:
4350
with:
4451
node-version: ${{ matrix.node-version }}
4552
cache: "npm"
53+
- name: Api node_modules cache
54+
id: api-node_modules-cache
55+
uses: actions/cache@v4
56+
with:
57+
path: ./packages/reva-api/node_modules
58+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
4659
- name: Installing dependencies
60+
if: steps.api-node_modules-cache.outputs.cache-hit != 'true'
4761
run: npm ci
4862
- name: Setup Postgres database
4963
uses: Daniel-Marynicz/postgresql-action@master

.github/workflows/e2e.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ jobs:
3131
with:
3232
node-version: 22.x
3333
cache: "npm"
34+
- name: Admin node_modules cache
35+
id: admin-node_modules-cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ./packages/reva-admin-react/node_modules
39+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
3440
- name: Installing dependencies
41+
if: steps.admin-node_modules-cache.outputs.cache-hit != 'true'
3542
run: npm ci
3643
- name: Build
3744
run: npm run build
@@ -50,9 +57,16 @@ jobs:
5057
with:
5158
node-version: 22.x
5259
cache: "npm"
60+
- name: Candidate node_modules cache
61+
id: candidate-node_modules-cache
62+
uses: actions/cache@v4
63+
with:
64+
path: ./packages/reva-candidate/node_modules
65+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
5366
- name: Installing dependencies
67+
if: steps.candidate-node_modules-cache.outputs.cache-hit != 'true'
5468
run: npm ci
5569
- name: Build
5670
run: npm run build
5771
- name: Running Test
58-
run: NODE_ENV=production npm run test:ci
72+
run: NODE_ENV=production npm run test:ci

.github/workflows/lint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ jobs:
1414
with:
1515
node-version: 22.x
1616
cache: "npm"
17+
- name: Api node_modules cache
18+
id: api-node_modules-cache
19+
uses: actions/cache@v4
20+
with:
21+
path: ./packages/reva-api/node_modules
22+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
1723
- name: Installing dependencies
24+
if: steps.api-node_modules-cache.outputs.cache-hit != 'true'
1825
run: npm ci
1926
- name: Running ESLint
2027
run: npm run lint
@@ -31,7 +38,14 @@ jobs:
3138
with:
3239
node-version: 22.x
3340
cache: "npm"
41+
- name: Admin node_modules cache
42+
id: admin-node_modules-cache
43+
uses: actions/cache@v4
44+
with:
45+
path: ./packages/reva-admin-react/node_modules
46+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
3447
- name: Installing dependencies
48+
if: steps.admin-node_modules-cache.outputs.cache-hit != 'true'
3549
run: npm ci
3650
- name: Running ESLint
3751
run: npm run lint
@@ -48,7 +62,14 @@ jobs:
4862
with:
4963
node-version: 22.x
5064
cache: "npm"
65+
- name: Candidate node_modules cache
66+
id: candidate-node_modules-cache
67+
uses: actions/cache@v4
68+
with:
69+
path: ./packages/reva-candidate/node_modules
70+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
5171
- name: Installing dependencies
72+
if: steps.candidate-node_modules-cache.outputs.cache-hit != 'true'
5273
run: npm ci
5374
- name: Running ESLint
5475
run: npm run lint
@@ -65,7 +86,14 @@ jobs:
6586
with:
6687
node-version: 22.x
6788
cache: "npm"
89+
- name: Website node_modules cache
90+
id: website-node_modules-cache
91+
uses: actions/cache@v4
92+
with:
93+
path: ./packages/reva-website/node_modules
94+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
6895
- name: Installing dependencies
96+
if: steps.website-node_modules-cache.outputs.cache-hit != 'true'
6997
run: npm ci
7098
- name: Running ESLint
7199
run: npm run lint
@@ -82,7 +110,14 @@ jobs:
82110
with:
83111
node-version: 22.x
84112
cache: "npm"
113+
- name: VAE Collective node_modules cache
114+
id: vae-collective-node_modules-cache
115+
uses: actions/cache@v4
116+
with:
117+
path: ./packages/reva-vae-collective/node_modules
118+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
85119
- name: Installing dependencies
120+
if: steps.vae-collective-node_modules-cache.outputs.cache-hit != 'true'
86121
run: npm ci
87122
- name: Running ESLint
88123
run: npm run lint
@@ -99,7 +134,14 @@ jobs:
99134
with:
100135
node-version: 22.x
101136
cache: "npm"
137+
- name: Interop node_modules cache
138+
id: interop-node_modules-cache
139+
uses: actions/cache@v4
140+
with:
141+
path: ./packages/reva-interop/node_modules
142+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
102143
- name: Installing dependencies
144+
if: steps.interop-node_modules-cache.outputs.cache-hit != 'true'
103145
run: npm ci
104146
- name: Running ESLint
105147
run: npm run lint

.github/workflows/playwright.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ jobs:
1616
with:
1717
node-version: 20.x
1818
cache: "npm"
19-
- name: Install dependencies
19+
- name: Website node_modules cache
20+
id: website-node_modules-cache
21+
uses: actions/cache@v4
22+
with:
23+
path: ./packages/reva-website/node_modules
24+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
25+
- name: Installing dependencies
26+
if: steps.website-node_modules-cache.outputs.cache-hit != 'true'
2027
run: npm ci
2128
- name: Get Playwright version
2229
run: echo "PLAYWRIGHT_VERSION=`npm list | grep '@playwright/test'|sed 's/.*playwright\/test@//'`" >> $GITHUB_ENV
@@ -53,7 +60,14 @@ jobs:
5360
with:
5461
node-version: 22.x
5562
cache: "npm"
56-
- name: Install dependencies
63+
- name: VAE Collective node_modules cache
64+
id: vae-collective-node_modules-cache
65+
uses: actions/cache@v4
66+
with:
67+
path: ./packages/reva-vae-collective/node_modules
68+
key: node_modules-${{ hashFiles('**/package-lock.json') }}
69+
- name: Installing dependencies
70+
if: steps.vae-collective-node_modules-cache.outputs.cache-hit != 'true'
5771
run: npm ci
5872
- name: Get Playwright version
5973
run: echo "PLAYWRIGHT_VERSION=`npm list | grep '@playwright/test'|sed 's/.*playwright\/test@//'`" >> $GITHUB_ENV

0 commit comments

Comments
 (0)