Skip to content

Commit f45a48c

Browse files
committed
Test Redux published artifact in example build environments
1 parent 2a34af8 commit f45a48c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/test.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,74 @@ jobs:
127127
yarn tsc --version
128128
yarn check-types
129129
yarn test:types
130+
131+
test-published-artifact:
132+
name: Test Published Artifact ${{ matrix.example }}
133+
134+
needs: [build]
135+
runs-on: ubuntu-latest
136+
strategy:
137+
fail-fast: false
138+
matrix:
139+
node: ['16.x']
140+
example:
141+
[
142+
'cra4',
143+
'cra5',
144+
'next',
145+
'vite',
146+
'node-standard',
147+
'node-esm',
148+
'are-the-types-wrong'
149+
]
150+
steps:
151+
- name: Checkout repo
152+
uses: actions/checkout@v2
153+
154+
- name: Use node ${{ matrix.node }}
155+
uses: actions/setup-node@v2
156+
with:
157+
node-version: ${{ matrix.node }}
158+
cache: 'yarn'
159+
160+
- name: Clone RTK repo
161+
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit
162+
163+
- name: Check folder contents
164+
run: ls -l .
165+
166+
- name: Install deps
167+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
168+
run: yarn install
169+
170+
- uses: actions/download-artifact@v2
171+
with:
172+
name: package
173+
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
174+
175+
- name: Check folder contents
176+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
177+
run: ls -l .
178+
179+
- name: Install Redux-Thunk build artifact
180+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
181+
run: yarn add ./package.tgz
182+
183+
- name: Show installed package versions
184+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
185+
run: yarn info redux-thunk && yarn why redux-thunk
186+
187+
- name: Build example
188+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
189+
run: yarn build
190+
191+
- name: Run test step
192+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
193+
run: yarn test
194+
if: matrix.example != 'are-the-types-wrong'
195+
196+
- name: Run test step
197+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
198+
# Ignore "FalseCJS" errors in the `attw` job
199+
run: yarn test -n FalseCJS
200+
if: matrix.example == 'are-the-types-wrong'

0 commit comments

Comments
 (0)