Skip to content

Commit 59e332c

Browse files
committed
chore: simpler build script
1 parent 7fe0da5 commit 59e332c

File tree

1 file changed

+38
-136
lines changed

1 file changed

+38
-136
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,10 @@ jobs:
1717
- uses: actions/setup-node@v2
1818
with:
1919
node-version: 16
20-
- uses: actions/cache@v2
21-
id: cache
22-
env:
23-
CACHE_NAME: cache-node-modules
24-
with:
25-
path: |
26-
~/.npm
27-
./node_modules
28-
./packages/*/node_modules
29-
./packages/*/dist
30-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
31-
- name: Install Dependencies
32-
if: steps.cache.outputs.cache-hit != 'true'
33-
run: |
34-
npm install
35-
npm run build
36-
npm run link
20+
- uses: ipfs/aegir/actions/cache-node-modules@master
21+
with:
22+
build: |
23+
npm run link
3724
3825
check:
3926
name: Check
@@ -44,23 +31,10 @@ jobs:
4431
- uses: actions/setup-node@v2
4532
with:
4633
node-version: 16
47-
- uses: actions/cache@v2
48-
id: cache
49-
env:
50-
CACHE_NAME: cache-node-modules
51-
with:
52-
path: |
53-
~/.npm
54-
./node_modules
55-
./packages/*/node_modules
56-
./packages/*/dist
57-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
58-
- name: Install Dependencies
59-
if: steps.cache.outputs.cache-hit != 'true'
60-
run: |
61-
npm install
62-
npm run build
63-
npm run link
34+
- uses: ipfs/aegir/actions/cache-node-modules@master
35+
with:
36+
build: |
37+
npm run link
6438
- run: |
6539
npm run lint
6640
npm run dep-check -- -- -- -p
@@ -81,23 +55,10 @@ jobs:
8155
- uses: actions/setup-node@v2
8256
with:
8357
node-version: ${{ matrix.node }}
84-
- uses: actions/cache@v2
85-
id: cache
86-
env:
87-
CACHE_NAME: cache-node-modules
88-
with:
89-
path: |
90-
~/.npm
91-
./node_modules
92-
./packages/*/node_modules
93-
./packages/*/dist
94-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
95-
- name: Install Dependencies
96-
if: steps.cache.outputs.cache-hit != 'true'
97-
run: |
98-
npm install
99-
npm run build
100-
npm run link
58+
- uses: ipfs/aegir/actions/cache-node-modules@master
59+
with:
60+
build: |
61+
npm run link
10162
- run: npm run test:node -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
10263
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
10364
with:
@@ -215,23 +176,10 @@ jobs:
215176
- uses: actions/setup-node@v2
216177
with:
217178
node-version: 16
218-
- uses: actions/cache@v2
219-
id: cache
220-
env:
221-
CACHE_NAME: cache-node-modules
222-
with:
223-
path: |
224-
~/.npm
225-
./node_modules
226-
./packages/*/node_modules
227-
./packages/*/dist
228-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
229-
- name: Install Dependencies
230-
if: steps.cache.outputs.cache-hit != 'true'
231-
run: |
232-
npm install
233-
npm run build
234-
npm run link
179+
- uses: ipfs/aegir/actions/cache-node-modules@master
180+
with:
181+
build: |
182+
npm run link
235183
- uses: GabrielBB/xvfb-action@v1
236184
with:
237185
run: npm run test:electron-main -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
@@ -251,23 +199,10 @@ jobs:
251199
- uses: actions/setup-node@v2
252200
with:
253201
node-version: 16
254-
- uses: actions/cache@v2
255-
id: cache
256-
env:
257-
CACHE_NAME: cache-node-modules
258-
with:
259-
path: |
260-
~/.npm
261-
./node_modules
262-
./packages/*/node_modules
263-
./packages/*/dist
264-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
265-
- name: Install Dependencies
266-
if: steps.cache.outputs.cache-hit != 'true'
267-
run: |
268-
npm install
269-
npm run build
270-
npm run link
202+
- uses: ipfs/aegir/actions/cache-node-modules@master
203+
with:
204+
build: |
205+
npm run link
271206
- uses: GabrielBB/xvfb-action@v1
272207
with:
273208
run: npm run test:electron-renderer -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- --bail
@@ -294,23 +229,10 @@ jobs:
294229
- uses: actions/setup-node@v2
295230
with:
296231
node-version: 16
297-
- uses: actions/cache@v2
298-
id: cache
299-
env:
300-
CACHE_NAME: cache-node-modules
301-
with:
302-
path: |
303-
~/.npm
304-
./node_modules
305-
./packages/*/node_modules
306-
./packages/*/dist
307-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
308-
- name: Install Dependencies
309-
if: steps.cache.outputs.cache-hit != 'true'
310-
run: |
311-
npm install
312-
npm run build
313-
npm run link
232+
- uses: ipfs/aegir/actions/cache-node-modules@master
233+
with:
234+
build: |
235+
npm run link
314236
- run: npm run test:interop -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -- -t ${{ matrix.type }}
315237
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
316238
with:
@@ -340,23 +262,10 @@ jobs:
340262
- uses: actions/setup-node@v2
341263
with:
342264
node-version: 16
343-
- uses: actions/cache@v2
344-
id: cache
345-
env:
346-
CACHE_NAME: cache-node-modules
347-
with:
348-
path: |
349-
~/.npm
350-
./node_modules
351-
./packages/*/node_modules
352-
./packages/*/dist
353-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
354-
- name: Install Dependencies
355-
if: steps.cache.outputs.cache-hit != 'true'
356-
run: |
357-
npm install
358-
npm run build
359-
npm run link
265+
- uses: ipfs/aegir/actions/cache-node-modules@master
266+
with:
267+
build: |
268+
npm run link
360269
- run: npm run ${{ matrix.suite }} -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1 -- -- -t ${{ matrix.type }}
361270
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
362271
with:
@@ -374,27 +283,17 @@ jobs:
374283
- uses: actions/setup-node@v2
375284
with:
376285
node-version: 16
377-
- uses: actions/cache@v2
378-
id: cache
379-
env:
380-
CACHE_NAME: cache-node-modules
381-
with:
382-
path: |
383-
~/.npm
384-
./node_modules
385-
./packages/*/node_modules
386-
./packages/*/dist
387-
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
388-
- name: Install Dependencies
389-
if: steps.cache.outputs.cache-hit != 'true'
390-
run: |
391-
npm install
392-
npm run build
393-
npm run link
286+
- uses: ipfs/aegir/actions/cache-node-modules@master
287+
with:
288+
build: |
289+
npm run link
394290
- run: npm run test:interface:message-port-client -- --since ${{ github.event.pull_request.base.sha }} --concurrency 1
395291

396292
release:
397293
runs-on: ubuntu-latest
294+
needs: [
295+
build
296+
]
398297
# needs: [
399298
# test-node,
400299
# test-chrome,
@@ -423,6 +322,9 @@ jobs:
423322
node-version: lts/*
424323
registry-url: 'https://registry.npmjs.org'
425324
- uses: ipfs/aegir/actions/cache-node-modules@master
325+
with:
326+
build: |
327+
npm run link
426328
- uses: ipfs/aegir/actions/docker-login@master
427329
with:
428330
docker-token: ${{ secrets.DOCKER_TOKEN }}

0 commit comments

Comments
 (0)