Skip to content

Commit 16dc0ed

Browse files
authored
Cache the examples and speed up test runs (#2140)
1 parent 4d0b645 commit 16dc0ed

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -131,29 +131,23 @@ jobs:
131131
- name: Clone RTK repo
132132
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit
133133

134+
- name: Cache example deps
135+
uses: actions/cache@v4
136+
with:
137+
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}/node_modules
138+
key: test-published-artifact-${{ matrix.example }}-node_modules
139+
134140
- name: Check folder contents
135141
run: ls -l .
136142

137-
# Some weird install diffs with cloning this repo and installing.
138-
# Just kill the lockfiles for React-Redux and RTK and reinstall
139-
140-
- name: Remove React-Redux lockfile
141-
run: rm yarn.lock && rm package.json
142-
143-
- name: Remove RTK lockfile
144-
working-directory: ./redux-toolkit
145-
run: rm yarn.lock && rm package.json
146-
147-
- name: Install deps
143+
- name: Install example deps
148144
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
149-
env:
150-
YARN_ENABLE_IMMUTABLE_INSTALLS: false
151-
run: rm yarn.lock && yarn install
145+
run: yarn install
152146

153147
- name: Install Playwright browser if necessary
154148
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
155149
continue-on-error: true
156-
run: yarn playwright install
150+
run: yarn playwright install || true
157151

158152
- uses: actions/download-artifact@v4
159153
with:
@@ -172,13 +166,6 @@ jobs:
172166
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
173167
run: yarn info react-redux && yarn why react-redux
174168

175-
- name: Set up JDK 17 for React Native build
176-
if: matrix.example == 'react-native'
177-
uses: actions/setup-java@v4
178-
with:
179-
java-version: '17.x'
180-
distribution: 'temurin'
181-
182169
- name: Build example
183170
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
184171
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ coverage
55
es
66
temp/
77
react-redux-*/
8+
redux-toolkit/
89
.vscode/
910

1011
.cache/

0 commit comments

Comments
 (0)