-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.61 KB
/
compatibility-tests.yml
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
name: ✨ Compatibility Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
compatibility-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20, 22]
react: [17, 18]
name: Node.js ${{ matrix.node }} & React ${{ matrix.react }} Compatibility Test
steps:
# Step 1: Checkout code
- uses: actions/checkout@v4
# Step 2: Setup Node.js
- name: 🌟 Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# Step 3: Install dependencies with the target React version
- name: 📦 Install Dependencies with React ${{ matrix.react }}
run: |
echo "Installing React ${{ matrix.react }} and dependencies..."
npm install react@${{ matrix.react }} react-dom@${{ matrix.react }} --legacy-peer-deps
npm install --legacy-peer-deps
# Step 4: Test build
- name: 🛠️ Test Build Compatibility
run: |
echo "🔨 Testing build compatibility with Node.js ${{ matrix.node }} and React ${{ matrix.react }}..."
npm run build || echo "❌ Build failed for Node.js ${{ matrix.node }} & React ${{ matrix.react }} 😿" >> incompatibility.log
# Step 5: Print incompatibility log
- name: 📝 Print Compatibility Results
if: always()
run: |
if [ -f incompatibility.log ]; then
echo "🚨 Compatibility Issues Found: 😓"
cat incompatibility.log
else
echo "🌈 All tested versions are compatible! 🎉"
fi