Skip to content

Commit

Permalink
ci: run multiple versions, to ensure it works with all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
thebuilder committed Jun 8, 2024
1 parent 01c9992 commit 88b5d75
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test

on: [ push, pull_request ]
on: [push, pull_request]

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -13,7 +13,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Lint
Expand All @@ -24,3 +24,35 @@ jobs:
CI: true
- name: Build
run: pnpm build

test_matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
react:
- 16
- 17
- 18
- latest
- rc
steps:
- run: corepack enable
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Install legacy testing-library
if: ${{ startsWith(matrix.react, '16') || startsWith(matrix.react, '17') }}
run: pnpm add -D @testing-library/react@12.1.4
- name: Install legacy types
if: ${{ startsWith(matrix.react, '16') || startsWith(matrix.react, '17') || startsWith(matrix.react, '18') }}
run: pnpm add -D @types/react@${{ matrix.react }} @types/react-dom@${{ matrix.react }}
- name: Test ${{ matrix.react }} ${{ matrix.devtools-skip }}
run: |
pnpm add -D react@${{ matrix.react }} react-dom@${{ matrix.react }}
pnpm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-workspace-root-check=true

0 comments on commit 88b5d75

Please sign in to comment.