1
1
name : CI
2
2
3
- on :
4
- push :
5
- branches : [master]
6
- pull_request :
7
- branches : [master]
3
+ on : [push, pull_request, workflow_dispatch]
8
4
9
5
jobs :
10
6
build :
@@ -69,13 +65,15 @@ jobs:
69
65
node-version : ${{ matrix.node }}
70
66
cache : ' yarn'
71
67
68
+ - name : Download build artifact
69
+ uses : actions/download-artifact@v4
70
+ with :
71
+ name : package
72
+ path : .
73
+
72
74
- name : Install deps
73
75
run : yarn install
74
76
75
- # Build with the actual TS version in the repo
76
- - name : Pack
77
- run : yarn build && yarn pack
78
-
79
77
- name : Install build artifact
80
78
run : yarn add ./package.tgz
81
79
@@ -85,11 +83,12 @@ jobs:
85
83
86
84
# Remove config line that points "reselect" to the `src` folder,
87
85
# so that the typetest will use the installed version instead
88
- - run : sed -i -e /@remap-prod-remove-line/d tsconfig.base.json vitest.config.mts
86
+ - name : Erase path aliases
87
+ run : sed -i -e /@remap-prod-remove-line/d tsconfig.base.json vitest.config.mts
89
88
90
89
- name : Test types
91
90
run : |
92
- ./node_modules/.bin/ tsc --version
91
+ yarn tsc --version
93
92
yarn type-tests
94
93
95
94
are-the-types-wrong :
@@ -105,7 +104,8 @@ jobs:
105
104
- name : Checkout repo
106
105
uses : actions/checkout@v4
107
106
108
- - uses : actions/download-artifact@v4
107
+ - name : Download build artifact
108
+ uses : actions/download-artifact@v4
109
109
with :
110
110
name : package
111
111
path : .
@@ -150,16 +150,6 @@ jobs:
150
150
- name : Check folder contents
151
151
run : ls -l .
152
152
153
- # Some weird install diffs with cloning this repo and installing.
154
- # Just kill the lockfiles for this repo and RTK and reinstall
155
-
156
- - name : Remove top lockfile
157
- run : rm yarn.lock && rm package.json
158
-
159
- - name : Remove RTK lockfile
160
- working-directory : ./redux-toolkit
161
- run : rm yarn.lock && rm package.json
162
-
163
153
- name : Install deps
164
154
working-directory : ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
165
155
env :
@@ -208,3 +198,43 @@ jobs:
208
198
- name : Run test step
209
199
working-directory : ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
210
200
run : yarn test
201
+
202
+ test-dist :
203
+ name : Run local tests against build artifact
204
+ needs : [build]
205
+ runs-on : ubuntu-latest
206
+ strategy :
207
+ fail-fast : false
208
+ matrix :
209
+ node : ['20.x']
210
+
211
+ steps :
212
+ - name : Checkout repo
213
+ uses : actions/checkout@v4
214
+
215
+ - name : Use node ${{ matrix.node }}
216
+ uses : actions/setup-node@v4
217
+ with :
218
+ node-version : ${{ matrix.node }}
219
+ cache : ' yarn'
220
+
221
+ - name : Install dependencies
222
+ run : yarn install
223
+
224
+ - name : Download build artifact
225
+ uses : actions/download-artifact@v4
226
+ with :
227
+ name : package
228
+ path : .
229
+
230
+ - name : Check folder contents
231
+ run : ls -lah
232
+
233
+ - name : Install build artifact
234
+ run : yarn add ./package.tgz
235
+
236
+ - name : Erase path aliases
237
+ run : sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./vitest.config.mts
238
+
239
+ - name : Run local tests against the build artifact
240
+ run : yarn test
0 commit comments