From 9be4331ed13a93194f98984cce775605da737ae4 Mon Sep 17 00:00:00 2001 From: Khartir <thomas.gnandt@mayflower.de> Date: Sat, 30 Nov 2019 14:01:41 +0100 Subject: [PATCH 1/7] Test backwards compatibility action --- .github/workflows/backwards.yml | 31 +++++++++++++++++++++++++++++++ package.json | 5 +---- 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/backwards.yml diff --git a/.github/workflows/backwards.yml b/.github/workflows/backwards.yml new file mode 100644 index 00000000..df47b68c --- /dev/null +++ b/.github/workflows/backwards.yml @@ -0,0 +1,31 @@ +name: Test backwards compatiblity + +on: [push] + +jobs: + build: + name: Test 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/package.json b/package.json index 726bd4ba..b4affa67 100644 --- a/package.json +++ b/package.json @@ -20,13 +20,11 @@ "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", "build:packages": "lerna run --scope 'react-async*' build", "build:examples": "lerna run --scope '*-example' build", @@ -69,7 +67,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 +80,4 @@ "resolutions": { "@types/react": "16.9.13" } -} +} \ No newline at end of file From ea6f2df2df9b2dda5db79afe8104a7bef6b658ef Mon Sep 17 00:00:00 2001 From: Khartir <thomas.gnandt@mayflower.de> Date: Sat, 30 Nov 2019 14:15:04 +0100 Subject: [PATCH 2/7] Test forwards & latest compatibility action --- .github/workflows/forwards.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/latest.yml | 31 +++++++++++++++++++++++++++++++ package.json | 3 --- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/forwards.yml create mode 100644 .github/workflows/latest.yml diff --git a/.github/workflows/forwards.yml b/.github/workflows/forwards.yml new file mode 100644 index 00000000..a7f44e79 --- /dev/null +++ b/.github/workflows/forwards.yml @@ -0,0 +1,31 @@ +name: Test compatiblity with react@next + +on: [push] + +jobs: + build: + name: Test 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..1de58dae --- /dev/null +++ b/.github/workflows/latest.yml @@ -0,0 +1,31 @@ +name: Test compatiblity with react@latest + +on: [push] + +jobs: + build: + name: Test 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/package.json b/package.json index b4affa67..95e8c121 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,6 @@ "test:watch": "yarn test -- --watch", "test:devtools": "jest react-async-devtools/src", "test:components": "jest src/Async.spec.js --collectCoverageFrom=src/Async.js", - "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", "ci": "yarn lint && yarn test:compat && yarn test:examples", From 26cf9546e06e58b6bef8dca34c83159753fd27b3 Mon Sep 17 00:00:00 2001 From: Khartir <thomas.gnandt@mayflower.de> Date: Sat, 30 Nov 2019 14:34:45 +0100 Subject: [PATCH 3/7] Fix documentation --- CONTRIBUTING.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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 From 7a216c5811a1ae76a31ba9b68538bcd740e836bd Mon Sep 17 00:00:00 2001 From: Khartir <thomas.gnandt@mayflower.de> Date: Sat, 30 Nov 2019 14:44:04 +0100 Subject: [PATCH 4/7] fix other CI tools --- .circleci/config.yml | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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/package.json b/package.json index 95e8c121..7a847a55 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:components": "jest src/Async.spec.js --collectCoverageFrom=src/Async.js", "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", - "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", From 08a562c65754ce3c4a81aba307c575dcdb16cf32 Mon Sep 17 00:00:00 2001 From: Khartir <thomas.gnandt@mayflower.de> Date: Sat, 30 Nov 2019 18:14:47 +0100 Subject: [PATCH 5/7] rename jobs --- .github/workflows/backwards.yml | 4 ++-- .github/workflows/forwards.yml | 4 ++-- .github/workflows/latest.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/backwards.yml b/.github/workflows/backwards.yml index df47b68c..cf86bfbb 100644 --- a/.github/workflows/backwards.yml +++ b/.github/workflows/backwards.yml @@ -3,8 +3,8 @@ name: Test backwards compatiblity on: [push] jobs: - build: - name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} + test_backwards: + name: Test backwards on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/forwards.yml b/.github/workflows/forwards.yml index a7f44e79..7bf48823 100644 --- a/.github/workflows/forwards.yml +++ b/.github/workflows/forwards.yml @@ -3,8 +3,8 @@ name: Test compatiblity with react@next on: [push] jobs: - build: - name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} + test_forwards: + name: Test forwards on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml index 1de58dae..5dafae8d 100644 --- a/.github/workflows/latest.yml +++ b/.github/workflows/latest.yml @@ -3,8 +3,8 @@ name: Test compatiblity with react@latest on: [push] jobs: - build: - name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }} + test_latest: + name: Test latest on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: From 0681d8d3adfe31dc7fc4181c4c7243a9a919da8f Mon Sep 17 00:00:00 2001 From: Thomas Gnandt <thomas.gnandt@mayflower.de> Date: Fri, 13 Dec 2019 13:13:34 +0100 Subject: [PATCH 6/7] Fix travis tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a3950cdf..0c5271bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ cache: yarn: true directories: - node_modules -script: yarn && yarn ci +script: yarn && yarn bootstrap && yarn ci after_success: - bash <(curl -s https://codecov.io/bash) -e TRAVIS_NODE_VERSION From fd12594ff97c2475be450bcf35d6fc9e1a2eddf1 Mon Sep 17 00:00:00 2001 From: Thomas Gnandt <thomas.gnandt@mayflower.de> Date: Fri, 13 Dec 2019 13:22:58 +0100 Subject: [PATCH 7/7] prevent npm install on travis --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0c5271bd..aaad4b5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ cache: yarn: true directories: - node_modules -script: yarn && yarn bootstrap && yarn ci +install: + - yarn +script: yarn bootstrap && yarn ci after_success: - bash <(curl -s https://codecov.io/bash) -e TRAVIS_NODE_VERSION