Browse Source

ci: use node 16 (#40800)

* chore: use node 16

* chore: all lock ver

* chore: size-limit

* chore: mv clean up logic into master
pull/40785/head
二货爱吃白萝卜 2 years ago
committed by GitHub
parent
commit
5dfce54437
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/size-limit.yml
  2. 33
      .github/workflows/test.yml
  3. 15
      tests/setup.js

4
.github/workflows/size-limit.yml

@ -25,6 +25,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: cache package-lock.json - name: cache package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:

33
.github/workflows/test.yml

@ -19,6 +19,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: cache package-lock.json - name: cache package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -51,6 +55,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -73,6 +81,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -97,6 +109,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -136,6 +152,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -209,6 +229,11 @@ jobs:
needs: [normal-test] needs: [normal-test]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: coverage-artifacts name: coverage-artifacts
@ -231,6 +256,10 @@ jobs:
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@ -278,6 +307,10 @@ jobs:
if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }}
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: restore cache from package-lock.json - name: restore cache from package-lock.json
# lib only run in master branch not in pull request # lib only run in master branch not in pull request
if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }}

15
tests/setup.js

@ -4,6 +4,21 @@ const util = require('util');
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log('Current React Version:', React.version); console.log('Current React Version:', React.version);
const originConsoleErr = console.error;
// Hack off React warning to avoid too large log in CI.
console.error = (...args) => {
const str = args.join('').replace(/\n/g, '');
if (
['validateDOMNesting', 'on an unmounted component', 'not wrapped in act'].every(
(warn) => !str.includes(warn),
)
) {
originConsoleErr(...args);
}
};
/* eslint-disable global-require */ /* eslint-disable global-require */
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {
global.window.resizeTo = (width, height) => { global.window.resizeTo = (width, height) => {

Loading…
Cancel
Save