diff --git a/.circleci/config.yml b/.circleci/config.yml index c3da2c0b..f22d1b1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,8 +50,7 @@ jobs: - attach_workspace: at: . - run: - name: Test with compatibility checks - command: yarn test:compat + command: yarn test - persist_to_workspace: root: . paths: diff --git a/.github/workflows/backwards.yml b/.github/workflows/backwards.yml new file mode 100644 index 00000000..cf86bfbb --- /dev/null +++ b/.github/workflows/backwards.yml @@ -0,0 +1,31 @@ +name: Test backwards compatiblity + +on: [push] + +jobs: + test_backwards: + name: Test backwards on node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [10] + steps: + - uses: actions/setup-node@v1 + with: + node-version: "10.x" + - uses: actions/checkout@v1 + - name: Cache node modules + id: cache-modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-buildBackwards-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.OS }}-buildBackwards-${{ env.cache-name }}- + ${{ runner.OS }}-buildBackwards- + - name: Install + if: steps.cache-modules.outputs.cache-hit != 'true' + run: yarn add -D -W react@16.3.1 react-dom@16.3.1 + - name: Test + run: yarn test:components diff --git a/.github/workflows/forwards.yml b/.github/workflows/forwards.yml new file mode 100644 index 00000000..7bf48823 --- /dev/null +++ b/.github/workflows/forwards.yml @@ -0,0 +1,31 @@ +name: Test compatiblity with react@next + +on: [push] + +jobs: + test_forwards: + name: Test forwards on node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [10] + steps: + - uses: actions/setup-node@v1 + with: + node-version: "10.x" + - uses: actions/checkout@v1 + - name: Cache node modules + id: cache-modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-buildForwards-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.OS }}-buildForwards-${{ env.cache-name }}- + ${{ runner.OS }}-buildForwards- + - name: Install + if: steps.cache-modules.outputs.cache-hit != 'true' + run: yarn add -D -W react@next react-dom@next + - name: Test + run: yarn test diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml new file mode 100644 index 00000000..5dafae8d --- /dev/null +++ b/.github/workflows/latest.yml @@ -0,0 +1,31 @@ +name: Test compatiblity with react@latest + +on: [push] + +jobs: + test_latest: + name: Test latest on node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [10] + steps: + - uses: actions/setup-node@v1 + with: + node-version: "10.x" + - uses: actions/checkout@v1 + - name: Cache node modules + id: cache-modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-buildLatest-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.OS }}-buildLatest-${{ env.cache-name }}- + ${{ runner.OS }}-buildLatest- + - name: Install + if: steps.cache-modules.outputs.cache-hit != 'true' + run: yarn add -D -W react@latest react-dom@latest + - name: Test + run: yarn test diff --git a/.travis.yml b/.travis.yml index a3950cdf..aaad4b5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ cache: yarn: true directories: - node_modules -script: yarn && yarn ci +install: + - yarn +script: yarn bootstrap && yarn ci after_success: - bash <(curl -s https://codecov.io/bash) -e TRAVIS_NODE_VERSION diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3303808..5b278ae7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,15 +65,7 @@ Use the following command to test all packages in watch mode. Refer to the [Jest yarn test:watch ``` -In general, this is sufficient during development. Travis CI will apply a more rigorous set of tests. - -#### Testing for compatibility - -```sh -yarn test:compat -``` - -This runs all tests using various versions of `react` and `react-dom`, to check for compatibility with older/newer versions of React. This is what CircleCI and Travis run. +In general, this is sufficient during development. The CI will apply a more rigorous set of tests. ### Working with the examples diff --git a/package.json b/package.json index 726bd4ba..7a847a55 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,9 @@ "test:watch": "yarn test -- --watch", "test:devtools": "jest react-async-devtools/src", "test:components": "jest src/Async.spec.js --collectCoverageFrom=src/Async.js", - "test:backwards": "yarn add -D -W react@16.3.1 react-dom@16.3.1 && yarn resolutions:fix-react && yarn test:components", - "test:forwards": "yarn add -D -W react@next react-dom@next && yarn resolutions:fix-react && yarn test", - "test:latest": "yarn add -D -W react@latest react-dom@latest && yarn resolutions:fix-react && yarn test", - "test:compat": "yarn test:backwards && yarn test:forwards && yarn test:latest", "test:examples": "CI=1 lerna run --scope '*-example' test -- --passWithNoTests --watchAll=false", "test:chromatic": "chromatic --app-code iiua39bmt0j --build-script-name build:storybook --exit-zero-on-changes", - "resolutions:fix-react": "jq '.resolutions.react = .devDependencies.react|.resolutions.\"react-dom\"=.devDependencies.react' package.json > package.json.new && mv package.json.new package.json && yarn install", - "ci": "yarn lint && yarn test:compat && yarn test:examples", + "ci": "yarn lint && yarn test && yarn test:examples", "build:packages": "lerna run --scope 'react-async*' build", "build:examples": "lerna run --scope '*-example' build", "build:storybook": "build-storybook -o storybook", @@ -69,7 +64,6 @@ "eslint-plugin-react-hooks": "2.3.0", "jest": "24.9.0", "lerna": "3.19.0", - "node-jq": "1.11.0", "now": "16.6.3", "npm-run-all": "4.1.5", "prettier": "1.19.1", @@ -83,4 +77,4 @@ "resolutions": { "@types/react": "16.9.13" } -} +} \ No newline at end of file