React Compatibility #44
This file contains hidden or 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: 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 |