@@ -28,19 +28,88 @@ jobs:
28
28
needs : changes
29
29
if : ${{ needs.changes.outputs.codegen == 'true' }}
30
30
31
- runs-on : ubuntu-latest
31
+ defaults :
32
+ run :
33
+ working-directory : ./packages/rtk-query-codegen-openapi
34
+
35
+ runs-on : ${{ matrix.os }}
36
+
37
+ name : Build artifact for ${{ matrix.os }} with Node.js ${{ matrix.node-version }}
32
38
33
39
strategy :
34
40
matrix :
35
41
node-version : ['20.x']
42
+ os : [ubuntu-latest]
36
43
37
44
steps :
38
- - uses : actions/checkout@v4
39
- - name : Use Node.js ${{ matrix.node-version }}
45
+ - name : Checkout repository
46
+ uses : actions/checkout@v4
47
+
48
+ - name : Setup Node.js ${{ matrix.node-version }}
40
49
uses : actions/setup-node@v4
41
50
with :
42
- node-version : ${{ matrix.node }}
51
+ node-version : ${{ matrix.node-version }}
43
52
cache : ' yarn'
44
53
45
- - run : yarn install
46
- - run : yarn test
54
+ - name : Install dependencies
55
+ run : yarn install
56
+
57
+ - name : Pack
58
+ run : yarn pack
59
+
60
+ - name : Upload artifact
61
+ uses : actions/upload-artifact@v4
62
+ id : artifact-upload-step
63
+ with :
64
+ name : package
65
+ path : ./packages/rtk-query-codegen-openapi/package.tgz
66
+
67
+ - name : Did we fail?
68
+ if : failure()
69
+ run : ls -R
70
+
71
+ test :
72
+ needs : build
73
+ defaults :
74
+ run :
75
+ working-directory : ./packages/rtk-query-codegen-openapi
76
+ name : Test final build artifact with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
77
+ runs-on : ${{ matrix.os }}
78
+ strategy :
79
+ fail-fast : false
80
+ matrix :
81
+ node-version : [20.x]
82
+ os : [ubuntu-latest, windows-latest, macos-latest]
83
+
84
+ steps :
85
+ - name : Checkout repository
86
+ uses : actions/checkout@v4
87
+
88
+ - name : Setup Node.js ${{ matrix.node-version }}
89
+ uses : actions/setup-node@v4
90
+ with :
91
+ node-version : ${{ matrix.node-version }}
92
+ cache : ' yarn'
93
+
94
+ - name : Download artifact
95
+ id : download-artifact
96
+ uses : actions/download-artifact@v4
97
+ with :
98
+ path : ./packages/rtk-query-codegen-openapi
99
+ name : package
100
+
101
+ - name : Install dependencies
102
+ run : yarn install
103
+
104
+ - name : Install build artifact
105
+ run : yarn add ./package.tgz
106
+
107
+ - name : Remove path alias
108
+ run : sed -i -e /@remap-prod-remove-line/d ./tsconfig.json
109
+
110
+ - name : Run tests
111
+ run : yarn test
112
+
113
+ - name : Did we fail?
114
+ if : failure()
115
+ run : ls -R
0 commit comments