Skip to content

Commit 74eb7f9

Browse files
feat: support React 18 (#677)
* feat: support react18 * feat: update react * chore: update react-test-renderer * ci: fix ci for multiple react version * chore: update @testing-library/react-hooks * ci: remove react 16 and 17 job * Revert "ci: remove react 16 and 17 job" This reverts commit fdc9d7f. * test: move from @testing-library/react-hooks to @testing-library/react * test: fix test * fix: fix useCustomCompareLayoutEffect naming * ci: separate workflow * ci: fix react 16 and 17 workflow * ci: fix react 16 and 17 workflow * ci: fix react 16 and 17 workflow * ci: fix react 16 and 17 workflow
1 parent a155021 commit 74eb7f9

10 files changed

+24681
-956
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: CI
1+
name: Check
22
on: [pull_request]
33
jobs:
4-
build:
4+
check:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
node-version: [10.x, 12.x]
8+
node-version: [16.x]
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111
- name: Use Node.js ${{ matrix.node-version }}
12-
uses: actions/setup-node@v1
12+
uses: actions/setup-node@v3
1313
with:
1414
node-version: ${{ matrix.node-version }}
1515
- name: Install dependencies
@@ -18,9 +18,5 @@ jobs:
1818
run: |
1919
npm run lint:types
2020
npm run lint
21-
- name: Test
22-
run: npm test
23-
env:
24-
CI: true
2521
- name: Build
2622
run: npm run build

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test
2+
on: [pull_request]
3+
jobs:
4+
react-16-17:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node-version: [16.x]
9+
react-version: [^16.8.0, ^17]
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Use Node.js ${{ matrix.node-version }}
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install React ${{ matrix.react-version }}
19+
run: |
20+
npm install --D --legacy-peer-deps \
21+
react@${{ matrix.react-version }} \
22+
react-test-renderer@${{ matrix.react-version }} \
23+
@testing-library/react@12 \
24+
@testing-library/react-hooks
25+
- name: Replace @testing-library/react with @testing-library/react-hooks
26+
run: npx [email protected] '@testing-library/react' '@testing-library/react-hooks' tests -r
27+
- name: Test
28+
run: npm test
29+
env:
30+
CI: true
31+
react-18:
32+
runs-on: ubuntu-latest
33+
strategy:
34+
matrix:
35+
node-version: [16.x]
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Use Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
- name: Install dependencies
43+
run: npm ci
44+
- name: Test
45+
run: npm test
46+
env:
47+
CI: true

0 commit comments

Comments
 (0)