1
1
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2
2
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
3
4
- name : RTK-Query OpenAPI Codegen Tests
4
+ name : RTKQ OpenAPI Codegen
5
5
defaults :
6
6
run :
7
7
working-directory : ./packages/rtk-query-codegen-openapi
@@ -23,24 +23,94 @@ jobs:
23
23
codegen:
24
24
- 'packages/rtk-query-codegen-openapi/**'
25
25
- 'yarn.lock'
26
+ - '.github/workflows/test-codegen.yml'
26
27
27
28
build :
28
29
needs : changes
29
30
if : ${{ needs.changes.outputs.codegen == 'true' }}
30
31
31
- runs-on : ubuntu-latest
32
+ defaults :
33
+ run :
34
+ working-directory : ./packages/rtk-query-codegen-openapi
35
+
36
+ runs-on : ${{ matrix.os }}
37
+
38
+ name : Build artifact for ${{ matrix.os }} with Node ${{ matrix.node-version }}
32
39
33
40
strategy :
34
41
matrix :
35
42
node-version : ['20.x']
43
+ os : [ubuntu-latest]
36
44
37
45
steps :
38
- - uses : actions/checkout@v4
39
- - name : Use Node.js ${{ matrix.node-version }}
46
+ - name : Checkout repository
47
+ uses : actions/checkout@v4
48
+
49
+ - name : Setup Node ${{ matrix.node-version }}
40
50
uses : actions/setup-node@v4
41
51
with :
42
- node-version : ${{ matrix.node }}
52
+ node-version : ${{ matrix.node-version }}
43
53
cache : ' yarn'
44
54
45
- - run : yarn install
46
- - run : yarn test
55
+ - name : Install dependencies
56
+ run : yarn install
57
+
58
+ - name : Pack
59
+ run : yarn pack
60
+
61
+ - name : Upload artifact
62
+ uses : actions/upload-artifact@v4
63
+ id : artifact-upload-step
64
+ with :
65
+ name : package
66
+ path : ./packages/rtk-query-codegen-openapi/package.tgz
67
+
68
+ - name : Did we fail?
69
+ if : failure()
70
+ run : ls -R
71
+
72
+ test :
73
+ needs : build
74
+ defaults :
75
+ run :
76
+ working-directory : ./packages/rtk-query-codegen-openapi
77
+ name : Test final build artifact with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
78
+ runs-on : ${{ matrix.os }}
79
+ strategy :
80
+ fail-fast : false
81
+ matrix :
82
+ node-version : [20.x]
83
+ os : [ubuntu-latest]
84
+
85
+ steps :
86
+ - name : Checkout repository
87
+ uses : actions/checkout@v4
88
+
89
+ - name : Setup Node ${{ matrix.node-version }}
90
+ uses : actions/setup-node@v4
91
+ with :
92
+ node-version : ${{ matrix.node-version }}
93
+ cache : ' yarn'
94
+
95
+ - name : Download artifact
96
+ id : download-artifact
97
+ uses : actions/download-artifact@v4
98
+ with :
99
+ path : ./packages/rtk-query-codegen-openapi
100
+ name : package
101
+
102
+ - name : Install dependencies
103
+ run : yarn install
104
+
105
+ - name : Install build artifact
106
+ run : yarn add ./package.tgz
107
+
108
+ - name : Remove path alias
109
+ run : sed -i -e /@remap-prod-remove-line/d ./tsconfig.json
110
+
111
+ - name : Run tests
112
+ run : yarn test
113
+
114
+ - name : Did we fail?
115
+ if : failure()
116
+ run : ls -R
0 commit comments