Skip to content

Commit 45b64e2

Browse files
committed
Run against RTK examples
1 parent a0c7a4b commit 45b64e2

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,69 @@ jobs:
9797
- name: Run are-the-types-wrong
9898
run: npx @arethetypeswrong/cli ./package.tgz --format table --ignore-rules false-cjs no-resolution
9999

100+
test-published-artifact:
101+
name: Test Published Artifact ${{ matrix.example }}
102+
103+
needs: [build]
104+
runs-on: ubuntu-latest
105+
strategy:
106+
fail-fast: false
107+
matrix:
108+
node: ['16.x']
109+
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm']
110+
steps:
111+
- name: Checkout repo
112+
uses: actions/checkout@v2
113+
114+
- name: Use node ${{ matrix.node }}
115+
uses: actions/setup-node@v2
116+
with:
117+
node-version: ${{ matrix.node }}
118+
cache: 'yarn'
119+
120+
- name: Clone RTK repo
121+
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit
122+
123+
- name: Check out v2.0-integration
124+
working-directory: ./redux-toolkit
125+
run: git checkout v2.0-integration
126+
127+
- name: Check folder contents
128+
run: ls -l .
129+
130+
- name: Install deps
131+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
132+
env:
133+
# Some weird install diffs with cloning this repo and installing.
134+
# Don't care about lockfile diffs, so let it change.
135+
CI: false
136+
run: yarn install
137+
138+
- uses: actions/download-artifact@v2
139+
with:
140+
name: package
141+
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
142+
143+
- name: Check folder contents
144+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
145+
run: ls -l .
146+
147+
- name: Install build artifact
148+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
149+
run: yarn add ./package.tgz
150+
151+
- name: Show installed package versions
152+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
153+
run: yarn info react-redux && yarn why react-redux
154+
155+
- name: Build example
156+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
157+
run: yarn build
158+
159+
- name: Run test step
160+
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
161+
run: yarn test
162+
100163
test-published-artifact-local:
101164
name: Test Published Artifact (Local) ${{ matrix.example }}
102165

0 commit comments

Comments
 (0)