Skip to content

Commit 317be8e

Browse files
committed
Update test-codegen.yml with steps for building and testing artifacts
1 parent 3a07691 commit 317be8e

File tree

1 file changed

+75
-6
lines changed

1 file changed

+75
-6
lines changed

.github/workflows/test-codegen.yml

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,88 @@ jobs:
2828
needs: changes
2929
if: ${{ needs.changes.outputs.codegen == 'true' }}
3030

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 }}
3238

3339
strategy:
3440
matrix:
3541
node-version: ['20.x']
42+
os: [ubuntu-latest]
3643

3744
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 }}
4049
uses: actions/setup-node@v4
4150
with:
42-
node-version: ${{ matrix.node }}
51+
node-version: ${{ matrix.node-version }}
4352
cache: 'yarn'
4453

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

Comments
 (0)