Skip to content

Commit

Permalink
Cache the examples and speed up test runs (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Mar 11, 2024
1 parent 4d0b645 commit 16dc0ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,23 @@ jobs:
- name: Clone RTK repo
run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit

- name: Cache example deps
uses: actions/cache@v4
with:
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}/node_modules
key: test-published-artifact-${{ matrix.example }}-node_modules

- name: Check folder contents
run: ls -l .

# Some weird install diffs with cloning this repo and installing.
# Just kill the lockfiles for React-Redux and RTK and reinstall

- name: Remove React-Redux lockfile
run: rm yarn.lock && rm package.json

- name: Remove RTK lockfile
working-directory: ./redux-toolkit
run: rm yarn.lock && rm package.json

- name: Install deps
- name: Install example deps
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: rm yarn.lock && yarn install
run: yarn install

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

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

- name: Set up JDK 17 for React Native build
if: matrix.example == 'react-native'
uses: actions/setup-java@v4
with:
java-version: '17.x'
distribution: 'temurin'

- name: Build example
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coverage
es
temp/
react-redux-*/
redux-toolkit/
.vscode/

.cache/
Expand Down

0 comments on commit 16dc0ed

Please sign in to comment.