-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.6 KB
/
react-compat.yml
File metadata and controls
64 lines (51 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: React Compatibility
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run weekly on Tuesdays at 9 AM UTC
- cron: '0 9 * * 2'
workflow_dispatch:
jobs:
test-react-versions:
name: Test React ${{ matrix.react-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
react-version: ['18', '19']
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install React ${{ matrix.react-version }}
run: |
npm install --save-dev react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}
- name: Run tests with coverage
run: npm run test:coverage
- name: Upload coverage to Codecov
if: matrix.react-version == '18'
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
fail_ci_if_error: false
- name: Type check
run: npm run type-check
- name: Build
run: npm run build
- name: Update badge (React 18)
if: matrix.react-version == '18' && github.ref == 'refs/heads/main'
run: |
echo "React 18 compatibility: ✅ Passing" >> $GITHUB_STEP_SUMMARY
- name: Update badge (React 19)
if: matrix.react-version == '19' && github.ref == 'refs/heads/main'
run: |
echo "React 19 compatibility: ✅ Passing" >> $GITHUB_STEP_SUMMARY