diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e71518f..6210966 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,7 @@ jobs: strategy: matrix: node-version: [16.x, 18.x, 20.x] + react-version: [16, 17, 18, 19] steps: - uses: actions/checkout@v4 @@ -23,6 +24,20 @@ jobs: with: node-version: ${{ matrix.node-version }} - - run: npm ci + # Add caching + - uses: actions/cache@v3 + id: npm-cache + with: + path: node_modules + key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}- + + # Only run npm ci if cache missed + - if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm ci + + # Override React versions + - run: npm install --no-save react@^${{ matrix.react-version }} react-is@^${{ matrix.react-version }} - run: npm test diff --git a/package.json b/package.json index 8ae94ac..0b1a2c3 100644 --- a/package.json +++ b/package.json @@ -21,18 +21,10 @@ "test": "tsx index.spec.tsx", "prepublishOnly": "npm run build" }, - "keywords": [ - "react", - "fragment", - "flatten", - "children", - "utility" - ], + "keywords": ["react", "fragment", "flatten", "children", "utility"], "author": "Tom McKenzie ", "license": "MIT", - "files": [ - "dist/" - ], + "files": ["dist/"], "devDependencies": { "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.2.0", @@ -51,7 +43,7 @@ "typescript": "^5.0.4" }, "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-is": "^18.0.0 || ^19.0.0" + "react": ">=15.0.0", + "react-is": ">=16.0.0" } }