diff --git a/.github/workflows/size-limit.yml b/.github/workflows/size-limit.yml index bcce41cd74..147e80e5bd 100644 --- a/.github/workflows/size-limit.yml +++ b/.github/workflows/size-limit.yml @@ -25,6 +25,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: cache package-lock.json uses: actions/cache@v3 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78d828022c..76f053b7ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: cache package-lock.json uses: actions/cache@v3 with: @@ -51,6 +55,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -73,6 +81,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -97,6 +109,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -136,6 +152,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -209,6 +229,11 @@ jobs: needs: [normal-test] steps: - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 16 + - uses: actions/download-artifact@v3 with: name: coverage-artifacts @@ -231,6 +256,10 @@ jobs: - name: checkout uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json uses: actions/cache@v3 with: @@ -278,6 +307,10 @@ jobs: if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: restore cache from package-lock.json # lib only run in master branch not in pull request if: ${{ github.event_name != 'pull_request' || matrix.module != 'lib' }} diff --git a/tests/setup.js b/tests/setup.js index 8623ee6bb0..25f9bf9901 100644 --- a/tests/setup.js +++ b/tests/setup.js @@ -4,6 +4,21 @@ const util = require('util'); // eslint-disable-next-line no-console 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 */ if (typeof window !== 'undefined') { global.window.resizeTo = (width, height) => {