Skip to content

Commit 83781d0

Browse files
committed
chore: use actions to upload/download artifacts
1 parent 97e7695 commit 83781d0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/unit-test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,34 @@ on:
55
pull_request:
66

77
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
runs-on: ubuntu-latest
12+
env:
13+
NPM_CONFIG_UNSAFE_PERM: true
14+
NODE_OPTIONS: --max-old-space-size=4096
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 16
23+
- name: Install
24+
run: npm ci
25+
- name: Build
26+
run: npm run compile
27+
- name: Upload build artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: build-cache-${{ github.ref_name }}
31+
path: node_modules/.cache/nx
32+
retention-days: 1
33+
834
unit-test:
35+
needs: build
936
strategy:
1037
fail-fast: false
1138
matrix:
@@ -128,6 +155,11 @@ jobs:
128155
run: npm install -g npm@9 # npm@9 supports node >=14.17.0
129156
- name: Install
130157
run: npm ci
158+
- name: Dowload Artifacts
159+
uses: actions/download-artifact@v4
160+
with:
161+
name: $build-cache-${{ github.ref_name }}
162+
path: node_modules/.cache/nx
131163
- name: Build
132164
run: npm run compile
133165
- name: Unit tests (Full)
@@ -145,6 +177,7 @@ jobs:
145177
verbose: true
146178

147179
browser-test:
180+
needs: build
148181
strategy:
149182
fail-fast: false
150183
matrix:
@@ -166,6 +199,11 @@ jobs:
166199
run: npm install -g npm@9 # npm@9 supports node >=14.17.0
167200
- name: Install
168201
run: npm ci
202+
- name: Dowload Artifacts
203+
uses: actions/download-artifact@v4
204+
with:
205+
name: $build-cache-${{ github.ref_name }}
206+
path: node_modules/.cache/nx
169207
- name: Build
170208
run: npm run compile
171209
- name: Unit tests

0 commit comments

Comments
 (0)