|
|
@ -4,6 +4,11 @@ name: ✅ test |
|
|
|
|
|
|
|
on: [push, pull_request] |
|
|
|
|
|
|
|
# Cancel prev CI if new commit come |
|
|
|
concurrency: |
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
|
|
|
cancel-in-progress: true |
|
|
|
|
|
|
|
jobs: |
|
|
|
setup: |
|
|
|
runs-on: ubuntu-latest |
|
|
@ -37,43 +42,6 @@ jobs: |
|
|
|
if: steps.node_modules_cache_id.outputs.cache-hit != 'true' |
|
|
|
run: npm ci |
|
|
|
|
|
|
|
compile: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: cache lib |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: lib |
|
|
|
key: lib-${{ github.sha }} |
|
|
|
|
|
|
|
- name: cache es |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: es |
|
|
|
key: es-${{ github.sha }} |
|
|
|
|
|
|
|
- name: compile |
|
|
|
run: npm run compile |
|
|
|
|
|
|
|
- name: check |
|
|
|
run: node ./tests/dekko/lib.test.js |
|
|
|
needs: setup |
|
|
|
|
|
|
|
lint: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
@ -140,8 +108,9 @@ jobs: |
|
|
|
run: node ./scripts/check-demo.js |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-17-dom: |
|
|
|
name: react@17.x / dom |
|
|
|
################################ Dist ################################ |
|
|
|
dist: |
|
|
|
name: dist |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
@ -159,38 +128,21 @@ jobs: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test -- -w 1 --coverage |
|
|
|
|
|
|
|
- name: coverage |
|
|
|
run: bash <(curl -s https://codecov.io/bash) |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-17-node: |
|
|
|
name: react@17.x / node |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
- name: cache dist |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
path: dist |
|
|
|
key: dist-${{ github.sha }} |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm run test-node |
|
|
|
- name: dist |
|
|
|
run: npm run dist |
|
|
|
env: |
|
|
|
NODE_OPTIONS: --max_old_space_size=4096 |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-17-lib: |
|
|
|
name: react@17.x / lib |
|
|
|
############################### Style ################################ |
|
|
|
style-compile: |
|
|
|
name: es style compile |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
@ -214,45 +166,21 @@ jobs: |
|
|
|
path: lib |
|
|
|
key: lib-${{ github.sha }} |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: lib |
|
|
|
needs: compile |
|
|
|
|
|
|
|
react-17-es: |
|
|
|
name: react@17.x / es |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: restore cache from es |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: es |
|
|
|
key: es-${{ github.sha }} |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: es |
|
|
|
- name: lessc component |
|
|
|
run: npx lessc --js ./es/button/style/index.less |
|
|
|
|
|
|
|
- name: lessc mixins |
|
|
|
run: npx lessc --js ./es/style/mixins/index.less |
|
|
|
needs: compile |
|
|
|
|
|
|
|
react-17-dist: |
|
|
|
name: react@17.x / dist |
|
|
|
style-dist: |
|
|
|
name: dist style compile |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
@ -270,58 +198,44 @@ jobs: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: dist |
|
|
|
run: npm run dist |
|
|
|
env: |
|
|
|
NODE_OPTIONS: --max_old_space_size=4096 |
|
|
|
|
|
|
|
- name: check |
|
|
|
run: node ./tests/dekko/dist.test.js |
|
|
|
|
|
|
|
- name: bundlesize |
|
|
|
run: npm run bundlesize |
|
|
|
env: |
|
|
|
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }} |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: dist |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-16-dom: |
|
|
|
name: react@16.x / dom |
|
|
|
runs-on: ubuntu-latest |
|
|
|
env: |
|
|
|
REACT: 16 |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
- name: restore cache from lib |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: lib |
|
|
|
key: lib-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
- name: restore cache from es |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
path: es |
|
|
|
key: es-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
- name: restore cache from dist |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
path: dist |
|
|
|
key: dist-${{ github.sha }} |
|
|
|
|
|
|
|
- name: install react 16 |
|
|
|
run: npm run install-react-16 |
|
|
|
- name: lessc default |
|
|
|
run: npx lessc --js ./dist/antd.less |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test -- -w 1 --coverage |
|
|
|
needs: setup |
|
|
|
- name: lessc dark |
|
|
|
run: npx lessc --js ./dist/antd.dark.less |
|
|
|
|
|
|
|
react-16-node: |
|
|
|
name: react@16.x / node |
|
|
|
runs-on: ubuntu-latest |
|
|
|
- name: lessc variable |
|
|
|
run: npx lessc --js ./dist/antd.variable.less |
|
|
|
needs: [compile, dist] |
|
|
|
|
|
|
|
################################ Test ################################ |
|
|
|
normal-test: |
|
|
|
name: test |
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
react: ['16', '17'] |
|
|
|
module: ['dom', 'node', 'dist'] |
|
|
|
env: |
|
|
|
REACT: 16 |
|
|
|
REACT: ${{ matrix.react }} |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
@ -339,53 +253,53 @@ jobs: |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: install react 16 |
|
|
|
if: ${{ matrix.react == '16' }} |
|
|
|
run: npm run install-react-16 |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm run test-node |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-16-lib: |
|
|
|
name: react@16.x / lib |
|
|
|
runs-on: ubuntu-latest |
|
|
|
env: |
|
|
|
REACT: 16 |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
- name: restore cache from dist |
|
|
|
if: ${{ matrix.module == 'dist' }} |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
path: dist |
|
|
|
key: dist-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
- name: check |
|
|
|
if: ${{ matrix.module == 'dist' }} |
|
|
|
run: node ./tests/dekko/dist.test.js |
|
|
|
|
|
|
|
- name: restore cache from lib |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: lib |
|
|
|
key: lib-${{ github.sha }} |
|
|
|
# 17 only |
|
|
|
- name: bundlesize |
|
|
|
if: ${{ matrix.module == 'dist' && matrix.react == '17' }} |
|
|
|
run: npm run bundlesize |
|
|
|
env: |
|
|
|
BUNDLESIZE_GITHUB_TOKEN: ${{ secrets.BUNDLESIZE_GITHUB_TOKEN }} |
|
|
|
|
|
|
|
- name: install react 16 |
|
|
|
run: npm run install-react-16 |
|
|
|
# dom test |
|
|
|
- name: dom test |
|
|
|
if: ${{ matrix.module == 'dom' }} |
|
|
|
run: npm test -- -w 1 --coverage |
|
|
|
|
|
|
|
- name: test |
|
|
|
# > 17 only |
|
|
|
- name: coverage |
|
|
|
if: ${{ matrix.module == 'dom' && matrix.react == '17' }} |
|
|
|
run: bash <(curl -s https://codecov.io/bash) |
|
|
|
|
|
|
|
# node test |
|
|
|
- name: node test |
|
|
|
if: ${{ matrix.module == 'node' }} |
|
|
|
run: npm run test-node |
|
|
|
|
|
|
|
# dist test |
|
|
|
- name: dist test |
|
|
|
if: ${{ matrix.module == 'dist' }} |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: lib |
|
|
|
needs: compile |
|
|
|
LIB_DIR: dist |
|
|
|
needs: [setup, dist] |
|
|
|
|
|
|
|
react-16-es: |
|
|
|
name: react@16.x / es |
|
|
|
########################### Compile & Test ########################### |
|
|
|
compile: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
env: |
|
|
|
REACT: 16 |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
@ -402,26 +316,34 @@ jobs: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: restore cache from es |
|
|
|
- name: cache lib |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: lib |
|
|
|
key: lib-${{ github.sha }} |
|
|
|
|
|
|
|
- name: cache es |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: es |
|
|
|
key: es-${{ github.sha }} |
|
|
|
|
|
|
|
- name: install react 16 |
|
|
|
run: npm run install-react-16 |
|
|
|
- name: compile |
|
|
|
run: npm run compile |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: es |
|
|
|
needs: compile |
|
|
|
- name: check |
|
|
|
run: node ./tests/dekko/lib.test.js |
|
|
|
needs: setup |
|
|
|
|
|
|
|
react-16-dist: |
|
|
|
name: react@16.x / dist |
|
|
|
compiled-module-test: |
|
|
|
name: module test |
|
|
|
runs-on: ubuntu-latest |
|
|
|
strategy: |
|
|
|
matrix: |
|
|
|
react: ['16', '17'] |
|
|
|
module: [lib, es] |
|
|
|
env: |
|
|
|
REACT: 16 |
|
|
|
REACT: ${{ matrix.react }} |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
@ -438,62 +360,18 @@ jobs: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: restore cache from ${{ matrix.module }} |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: ${{ matrix.module }} |
|
|
|
key: ${{ matrix.module }}-${{ github.sha }} |
|
|
|
|
|
|
|
- name: install react 16 |
|
|
|
if: ${{ matrix.react == '16' }} |
|
|
|
run: npm run install-react-16 |
|
|
|
|
|
|
|
- name: dist |
|
|
|
run: npm run dist |
|
|
|
env: |
|
|
|
NODE_OPTIONS: --max_old_space_size=4096 |
|
|
|
|
|
|
|
- name: check |
|
|
|
run: node ./tests/dekko/dist.test.js |
|
|
|
|
|
|
|
- name: test |
|
|
|
run: npm test |
|
|
|
env: |
|
|
|
LIB_DIR: dist |
|
|
|
needs: setup |
|
|
|
|
|
|
|
style: |
|
|
|
name: style compile |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
|
|
|
|
- name: restore cache from package-lock.json |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: package-temp-dir |
|
|
|
key: lock-${{ github.sha }} |
|
|
|
|
|
|
|
- name: restore cache from node_modules |
|
|
|
uses: actions/cache@v3 |
|
|
|
with: |
|
|
|
path: node_modules |
|
|
|
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} |
|
|
|
|
|
|
|
- name: compile |
|
|
|
run: npm run compile |
|
|
|
|
|
|
|
- name: dist |
|
|
|
run: npm run dist |
|
|
|
env: |
|
|
|
NODE_OPTIONS: --max_old_space_size=4096 |
|
|
|
|
|
|
|
- name: lessc default |
|
|
|
run: npx lessc --js ./dist/antd.less |
|
|
|
|
|
|
|
- name: lessc dark |
|
|
|
run: npx lessc --js ./dist/antd.dark.less |
|
|
|
|
|
|
|
- name: lessc variable |
|
|
|
run: npx lessc --js ./dist/antd.variable.less |
|
|
|
|
|
|
|
- name: lessc component |
|
|
|
run: npx lessc --js ./es/button/style/index.less |
|
|
|
|
|
|
|
- name: lessc mixins |
|
|
|
run: npx lessc --js ./es/style/mixins/index.less |
|
|
|
needs: setup |
|
|
|
LIB_DIR: ${{ matrix.module }} |
|
|
|
needs: compile |