feat: add timeout to copy util. #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ✨ Compatibility Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
compatibility-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [16, 18, 20, 22] | |
react: [16, 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 |