From 55b3130857d47ccb68f70d5d77b9c18a83716fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 16:57:40 +0800 Subject: [PATCH 01/19] ci: add TEST_COMPONENT --- .github/workflows/test-component.yml | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/test-component.yml diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml new file mode 100644 index 0000000000..cad9417d02 --- /dev/null +++ b/.github/workflows/test-component.yml @@ -0,0 +1,85 @@ +name: TEST_COMPONENT + +on: + pull_request: + branches: [develop] + types: [opened, synchronize, reopened] + +jobs: + tdesign-vue: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-vue + path: target-repo + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: copy files to target-repo + run: cp -rf ./* target-repo/src/_common + + - name: + run: | + cd target-repo + npm install + npm run lint + npm run test + npm run build + + tdesign-vue-next: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-vue + path: target-repo + + - name: copy files to target-repo + run: cp -rf ./* target-repo/package/common + + - uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: + run: | + cd target-repo + pnpm install + pnpm run lint + pnpm run test + pnpm run build + + tdesign-react: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-react + path: target-repo + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: copy files to target-repo + run: cp -rf ./* target-repo/src/_common + + - name: + run: | + cd target-repo + npm install + npm run lint + npm run test + npm run build + From 22f09b411d7a237890deb0dbaabb1e9515481a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:02:17 +0800 Subject: [PATCH 02/19] chore: fix ci --- .github/workflows/test-component.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index cad9417d02..dc89cc3a87 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -14,18 +14,18 @@ jobs: - uses: actions/checkout@v4 with: repository: Tencent/tdesign-vue - path: target-repo + path: ../target-repo - uses: actions/setup-node@v4 with: node-version: 18 - name: copy files to target-repo - run: cp -rf ./* target-repo/src/_common + run: cp -rf ./* ../target-repo/src/_common - name: run: | - cd target-repo + cd ../target-repo npm install npm run lint npm run test @@ -39,10 +39,10 @@ jobs: - uses: actions/checkout@v4 with: repository: Tencent/tdesign-vue - path: target-repo + path: ../target-repo - name: copy files to target-repo - run: cp -rf ./* target-repo/package/common + run: cp -rf ./* ../target-repo/package/common - uses: pnpm/action-setup@v4 @@ -66,14 +66,14 @@ jobs: - uses: actions/checkout@v4 with: repository: Tencent/tdesign-react - path: target-repo + path: ../target-repo - uses: actions/setup-node@v4 with: node-version: 18 - name: copy files to target-repo - run: cp -rf ./* target-repo/src/_common + run: cp -rf ./* ../target-repo/src/_common - name: run: | From b208ee83b5420365b73f625b9781842625f52e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:08:03 +0800 Subject: [PATCH 03/19] chore: fix ci --- .github/workflows/test-component.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index dc89cc3a87..8c08a51f1f 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -10,22 +10,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-vue - uses: actions/checkout@v4 with: - repository: Tencent/tdesign-vue - path: ../target-repo + path: src/_common - uses: actions/setup-node@v4 with: node-version: 18 - - name: copy files to target-repo - run: cp -rf ./* ../target-repo/src/_common - - name: run: | - cd ../target-repo npm install npm run lint npm run test From 87afa4556bd7a8e20fd873480e0c88a718b97649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:14:46 +0800 Subject: [PATCH 04/19] chore: fix ci --- .github/workflows/test-component.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 8c08a51f1f..6dd00c44dd 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -16,17 +16,16 @@ jobs: - uses: actions/checkout@v4 with: path: src/_common + ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-node@v4 with: node-version: 18 - - - name: - run: | - npm install - npm run lint - npm run test - npm run build + + - run: npm install + - run: npm lint + - run: npm test + - run: npm build tdesign-vue-next: runs-on: ubuntu-latest From eb08e3ddbec07cf8d507054cfbc4d1039f43afcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:24:58 +0800 Subject: [PATCH 05/19] chore: ci --- .github/workflows/test-component.yml | 107 +++++++++++++++++++-------- 1 file changed, 75 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 6dd00c44dd..83292faa33 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -9,11 +9,13 @@ jobs: tdesign-vue: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout tdesign-vue + uses: actions/checkout@v4 with: repository: Tencent/tdesign-vue - - uses: actions/checkout@v4 + - name: Checkout tdesign-common + uses: actions/checkout@v4 with: path: src/_common ref: ${{ github.event.pull_request.head.sha }} @@ -23,22 +25,23 @@ jobs: node-version: 18 - run: npm install - - run: npm lint - - run: npm test - - run: npm build + - run: npm run lint + - run: npm run test + - run: npm run build tdesign-vue-next: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - uses: actions/checkout@v4 + - name: Checkout tdesign-vue-next + uses: actions/checkout@v4 with: - repository: Tencent/tdesign-vue - path: ../target-repo + repository: Tencent/tdesign-vue-next - - name: copy files to target-repo - run: cp -rf ./* ../target-repo/package/common + - name: Checkout tdesign-common + uses: actions/checkout@v4 + with: + path: packages/common + ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v4 @@ -46,36 +49,76 @@ jobs: with: node-version: 18 - - name: - run: | - cd target-repo - pnpm install - pnpm run lint - pnpm run test - pnpm run build + - run: pnpm install + - run: pnpm run lint + - run: pnpm run test + - run: pnpm run build tdesign-react: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - uses: actions/checkout@v4 + - name: Checkout tdesign-react + uses: actions/checkout@v4 with: repository: Tencent/tdesign-react - path: ../target-repo + + - name: Checkout tdesign-common + uses: actions/checkout@v4 + with: + path: src/_common + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - run: npm install + - run: npm run lint + - run: npm run test + - run: npm run build + + tdesign-mobile-vue: + runs-on: ubuntu-latest + steps: + - name: Checkout tdesign-mobile-vue + uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-mobile-vue + + - name: Checkout tdesign-common + uses: actions/checkout@v4 + with: + path: src/_common + ref: ${{ github.event.pull_request.head.sha }} - uses: actions/setup-node@v4 with: node-version: 18 + + - run: npm install + - run: npm run lint + - run: npm run test + - run: npm run build - - name: copy files to target-repo - run: cp -rf ./* ../target-repo/src/_common + tdesign-mobile-react: + runs-on: ubuntu-latest + steps: + - name: Checkout tdesign-mobile-react + uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-mobile-react - - name: - run: | - cd target-repo - npm install - npm run lint - npm run test - npm run build + - name: Checkout tdesign-common + uses: actions/checkout@v4 + with: + path: src/_common + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-node@v4 + with: + node-version: 18 + + - run: npm install + - run: npm run lint + - run: npm run test + - run: npm run build \ No newline at end of file From 7123ac1867a1b67e53b7b3cdbe27b30762ca6781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:30:12 +0800 Subject: [PATCH 06/19] chore: ci --- .github/workflows/test-component.yml | 33 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 83292faa33..8d8e4e4b55 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - + - run: npm install - run: npm run lint - run: npm run test @@ -71,7 +71,30 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - + + - run: npm install + - run: npm run lint + - run: npm run test + - run: npm run build + + tdesign-web-components: + runs-on: ubuntu-latest + steps: + - name: Checkout tdesign-web-components + uses: actions/checkout@v4 + with: + repository: Tencent/tdesign-web-components + + - name: Checkout tdesign-common + uses: actions/checkout@v4 + with: + path: src/_common + ref: ${{ github.event.pull_request.head.sha }} + + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: npm install - run: npm run lint - run: npm run test @@ -94,7 +117,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - + - run: npm install - run: npm run lint - run: npm run test @@ -117,8 +140,8 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18 - + - run: npm install - run: npm run lint - run: npm run test - - run: npm run build \ No newline at end of file + - run: npm run build From d26f8f20cbf516cac07711ed92419569969db7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:30:32 +0800 Subject: [PATCH 07/19] chore: ci --- .github/workflows/test-component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 8d8e4e4b55..21e1ac9649 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -83,7 +83,7 @@ jobs: - name: Checkout tdesign-web-components uses: actions/checkout@v4 with: - repository: Tencent/tdesign-web-components + repository: TDesignOteam/tdesign-web-components - name: Checkout tdesign-common uses: actions/checkout@v4 From 33ff563ed918873a96eb0125576fe1eae661bd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:44:09 +0800 Subject: [PATCH 08/19] chore: ci --- .github/workflows/test-component.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 21e1ac9649..192f9cb1fd 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -1,9 +1,10 @@ name: TEST_COMPONENT on: - pull_request: - branches: [develop] - types: [opened, synchronize, reopened] + workflow_run: + workflows: ["MAIN_PULL_REQUEST"] + types: + - completed jobs: tdesign-vue: From c4c101b7c2c1b1968407132bb3729d959fd36e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 17:53:12 +0800 Subject: [PATCH 09/19] chore: ci --- .github/workflows/test-component.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 192f9cb1fd..4d0c7b1f99 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -8,6 +8,9 @@ on: jobs: tdesign-vue: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue @@ -31,6 +34,9 @@ jobs: - run: npm run build tdesign-vue-next: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue-next @@ -56,6 +62,9 @@ jobs: - run: pnpm run build tdesign-react: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-react @@ -79,6 +88,9 @@ jobs: - run: npm run build tdesign-web-components: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-web-components @@ -102,6 +114,9 @@ jobs: - run: npm run build tdesign-mobile-vue: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-mobile-vue @@ -125,6 +140,9 @@ jobs: - run: npm run build tdesign-mobile-react: + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-mobile-react From 2dbde5960861b6a3cba21b20f1aedde4f8af0d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Thu, 6 Feb 2025 22:00:39 +0800 Subject: [PATCH 10/19] chore: ci --- .github/workflows/test-component.yml | 46 +++++++++++----------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 4d0c7b1f99..ebfaf87cf3 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -1,16 +1,15 @@ name: TEST_COMPONENT on: - workflow_run: - workflows: ["MAIN_PULL_REQUEST"] - types: - - completed + workflow_run: + workflows: + - MAIN_PULL_REQUEST + types: + - completed jobs: tdesign-vue: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue @@ -22,7 +21,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: actions/setup-node@v4 with: @@ -34,9 +33,7 @@ jobs: - run: npm run build tdesign-vue-next: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue-next @@ -48,7 +45,7 @@ jobs: uses: actions/checkout@v4 with: path: packages/common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: pnpm/action-setup@v4 @@ -62,9 +59,7 @@ jobs: - run: pnpm run build tdesign-react: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-react @@ -76,7 +71,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: actions/setup-node@v4 with: @@ -88,9 +83,7 @@ jobs: - run: npm run build tdesign-web-components: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-web-components @@ -102,7 +95,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: actions/setup-node@v4 with: @@ -114,9 +107,7 @@ jobs: - run: npm run build tdesign-mobile-vue: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-mobile-vue @@ -128,7 +119,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: actions/setup-node@v4 with: @@ -140,9 +131,7 @@ jobs: - run: npm run build tdesign-mobile-react: - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest steps: - name: Checkout tdesign-mobile-react @@ -154,7 +143,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.workflow_run.head_sha }} - uses: actions/setup-node@v4 with: @@ -164,3 +153,4 @@ jobs: - run: npm run lint - run: npm run test - run: npm run build + From 93b0078f29899d3f13affda350a037a6f14759a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 7 Feb 2025 12:33:16 +0800 Subject: [PATCH 11/19] chore: add .node-version --- .github/workflows/pull-request.yml | 6 +++--- .github/workflows/test-component.yml | 15 ++++++++------- .node-version | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .node-version diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0df8e5136d..3557930b19 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - uses: actions/cache@v4 env: cache-name: cache-nodemodules @@ -77,7 +77,7 @@ jobs: - name: init site deploy uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: | cp -rf style/web/* target-repo/src/_common/style/web cd target-repo/src/_common/ @@ -121,7 +121,7 @@ jobs: - name: init site deploy uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: | cp -rf style/mobile/* target-repo/src/_common/style/mobile cd target-repo/ diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index ebfaf87cf3..7f7986c823 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: npm install - run: npm run lint @@ -51,9 +51,10 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version + cache: 'pnpm' - - run: pnpm install + - run: pnpm install --frozen-lockfile - run: pnpm run lint - run: pnpm run test - run: pnpm run build @@ -75,7 +76,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: npm install - run: npm run lint @@ -99,7 +100,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: npm install - run: npm run lint @@ -123,7 +124,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: npm install - run: npm run lint @@ -147,7 +148,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version-file: .node-version - run: npm install - run: npm run lint diff --git a/.node-version b/.node-version new file mode 100644 index 0000000000..25bf17fc5a --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +18 \ No newline at end of file From b3073c5b5216b9cdb3bf69f3a40c43bae12c7f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 7 Feb 2025 22:12:35 +0800 Subject: [PATCH 12/19] ci(MAIN_PULL_REQUEST): save pr id --- .github/workflows/pull-request.yml | 27 +++++++++++++++------ .github/workflows/test-component.yml | 35 +++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3557930b19..0eb8dbfc44 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [develop, main] types: [opened, synchronize, reopened] - + jobs: check: runs-on: ubuntu-latest @@ -14,7 +14,7 @@ jobs: run: | log_emails=$(git log --pretty=format:"%ae %ce" -1) && if [[ ${log_emails} =~ '@tencent.com' ]];then echo $log_emails && echo "邮箱校验非法" && exit 2;else echo "邮箱校验通过";fi shell: bash - + test: runs-on: ubuntu-latest steps: @@ -32,9 +32,22 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- + - run: npm install + - run: npm run lint - - run: npm run test + + - run: npm run test + + - name: Save pr id + run: echo ${{ github.event.number }} > pr-id.txt + + - name: Upload pr id + uses: actions/upload-artifact@v4 + with: + name: pr-id + path: pr-id.txt + retention-days: 1 modify-web: runs-on: ubuntu-latest @@ -48,7 +61,7 @@ jobs: id: web-changed with: path: style/web - + modify-mobile: runs-on: ubuntu-latest outputs: @@ -60,7 +73,7 @@ jobs: - uses: tj-actions/changed-files@v45 id: mobile-changed with: - path: style/mobile + path: style/mobile build-web: runs-on: ubuntu-latest @@ -105,7 +118,7 @@ jobs: name: _site path: target-repo/_site.zip retention-days: 5 - + build-mobile: runs-on: ubuntu-latest needs: modify-mobile @@ -148,4 +161,4 @@ jobs: with: name: _site path: target-repo/_site.zip - retention-days: 5 \ No newline at end of file + retention-days: 5 diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 7f7986c823..c6b587741a 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -8,8 +8,26 @@ on: - completed jobs: + pr-success: + if: github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + outputs: + pr_id: ${{ steps.pr.outputs.id }} + steps: + - name: Download pr id + uses: dawidd6/action-download-artifact@v8 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + run_id: ${{ github.event.workflow_run.id }} + name: pr-id + + - name: Set pr id + id : pr + run: echo "id=$(cat pr-id.txt)" >> $GITHUB_OUTPUT + tdesign-vue: if: github.event.workflow_run.conclusion == 'success' + needs: pr-success runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue @@ -21,7 +39,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -35,6 +53,7 @@ jobs: tdesign-vue-next: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest + needs: pr-success steps: - name: Checkout tdesign-vue-next uses: actions/checkout@v4 @@ -45,7 +64,7 @@ jobs: uses: actions/checkout@v4 with: path: packages/common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: pnpm/action-setup@v4 @@ -62,6 +81,7 @@ jobs: tdesign-react: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest + needs: pr-success steps: - name: Checkout tdesign-react uses: actions/checkout@v4 @@ -72,7 +92,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -86,6 +106,7 @@ jobs: tdesign-web-components: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest + needs: pr-success steps: - name: Checkout tdesign-web-components uses: actions/checkout@v4 @@ -96,7 +117,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -110,6 +131,7 @@ jobs: tdesign-mobile-vue: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest + needs: pr-success steps: - name: Checkout tdesign-mobile-vue uses: actions/checkout@v4 @@ -120,7 +142,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -134,6 +156,7 @@ jobs: tdesign-mobile-react: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest + needs: pr-success steps: - name: Checkout tdesign-mobile-react uses: actions/checkout@v4 @@ -144,7 +167,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: ${{ github.event.workflow_run.head_sha }} + ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: From 1d77a044cc493cdaaf7ef25b6587d66641df0175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 7 Feb 2025 22:22:19 +0800 Subject: [PATCH 13/19] chore: ci --- .node-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.node-version b/.node-version index 25bf17fc5a..3c032078a4 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18 \ No newline at end of file +18 From d8424e2506a2a89abccd8e792e66e9a36571a333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Fri, 7 Feb 2025 22:32:53 +0800 Subject: [PATCH 14/19] ci: node-version --- .github/workflows/test-component.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index c6b587741a..53a986c3bb 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: npm install - run: npm run lint @@ -70,7 +70,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 cache: 'pnpm' - run: pnpm install --frozen-lockfile @@ -96,7 +96,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: npm install - run: npm run lint @@ -121,7 +121,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: npm install - run: npm run lint @@ -146,7 +146,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: npm install - run: npm run lint @@ -171,7 +171,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: npm install - run: npm run lint From 6042341da61c1b80f2bf5123ad80a3bb8499da95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sat, 8 Feb 2025 15:15:05 +0800 Subject: [PATCH 15/19] chore: ci --- .github/workflows/pull-request.yml | 6 +-- .github/workflows/test-component.yml | 77 +++++++++++++++++++++++----- .node-version | 1 - 3 files changed, 66 insertions(+), 18 deletions(-) delete mode 100644 .node-version diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0eb8dbfc44..415c73c503 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - uses: actions/cache@v4 env: cache-name: cache-nodemodules @@ -90,7 +90,7 @@ jobs: - name: init site deploy uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: | cp -rf style/web/* target-repo/src/_common/style/web cd target-repo/src/_common/ @@ -134,7 +134,7 @@ jobs: - name: init site deploy uses: actions/setup-node@v4 with: - node-version-file: .node-version + node-version: 18 - run: | cp -rf style/mobile/* target-repo/src/_common/style/mobile cd target-repo/ diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index 53a986c3bb..e8962771d9 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -8,7 +8,7 @@ on: - completed jobs: - pr-success: + pr-context: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest outputs: @@ -27,7 +27,7 @@ jobs: tdesign-vue: if: github.event.workflow_run.conclusion == 'success' - needs: pr-success + needs: pr-context runs-on: ubuntu-latest steps: - name: Checkout tdesign-vue @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -53,7 +53,7 @@ jobs: tdesign-vue-next: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - needs: pr-success + needs: pr-context steps: - name: Checkout tdesign-vue-next uses: actions/checkout@v4 @@ -64,7 +64,7 @@ jobs: uses: actions/checkout@v4 with: path: packages/common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: pnpm/action-setup@v4 @@ -81,7 +81,7 @@ jobs: tdesign-react: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - needs: pr-success + needs: pr-context steps: - name: Checkout tdesign-react uses: actions/checkout@v4 @@ -92,7 +92,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -106,7 +106,7 @@ jobs: tdesign-web-components: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - needs: pr-success + needs: pr-context steps: - name: Checkout tdesign-web-components uses: actions/checkout@v4 @@ -117,7 +117,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -131,7 +131,7 @@ jobs: tdesign-mobile-vue: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - needs: pr-success + needs: pr-context steps: - name: Checkout tdesign-mobile-vue uses: actions/checkout@v4 @@ -142,7 +142,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -156,7 +156,7 @@ jobs: tdesign-mobile-react: if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - needs: pr-success + needs: pr-context steps: - name: Checkout tdesign-mobile-react uses: actions/checkout@v4 @@ -167,7 +167,7 @@ jobs: uses: actions/checkout@v4 with: path: src/_common - ref: refs/pull/${{ needs.pr-success.outputs.pr_id }}/head + ref: refs/pull/${{ needs.pr-context.outputs.pr_id }}/head - uses: actions/setup-node@v4 with: @@ -177,4 +177,53 @@ jobs: - run: npm run lint - run: npm run test - run: npm run build - + + pr-comment: + if: always() + needs: + - tdesign-vue + - tdesign-vue-next + - tdesign-react + - tdesign-web-components + - tdesign-mobile-vue + - tdesign-mobile-react + runs-on: ubuntu-latest + steps: + - name: jobs report + id: report + uses: actions/github-script@v7 + with: + script: | + const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.runId, + per_page: 100 + }) + + const tdesign = jobs.filter(job => job.name.startsWith('tdesign-')) + + const run_url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` + + const comment =` + # TDesign Component Ecosystem CI [Open](${run_url}) + | Component | Status | Job | + |-----------|--------|-----| + ${tdesign.map(job => { + const status = job.conclusion === 'success' ? '✅' : '❌'; + return `| ${job.name} | ${status} | [Open](${job.html_url}) |` + console.log(job.name, process.env[job.name]); + }).join("\n")} + + + ` + + core.setOutput('comment', comment); + + - name: comment + uses: actions-cool/maintain-one-comment@v3 + with: + token: ${{ secrets.TDESIGN_BOT_TOKEN }} + number: ${{needs.pr-context.outputs.pr_id}} + body: ${{ steps.report.outputs.comment }} + body-include: '' \ No newline at end of file diff --git a/.node-version b/.node-version deleted file mode 100644 index 3c032078a4..0000000000 --- a/.node-version +++ /dev/null @@ -1 +0,0 @@ -18 From a6a7c3a5a8e6a06c366733363a3546dccd8454f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sat, 8 Feb 2025 15:19:43 +0800 Subject: [PATCH 16/19] chore: ci --- .github/workflows/test-component.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index e8962771d9..d320a8e9e8 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -207,8 +207,8 @@ jobs: const comment =` # TDesign Component Ecosystem CI [Open](${run_url}) - | Component | Status | Job | - |-----------|--------|-----| + | Component | Status | Job | + | :-------: | :----: | :--: | ${tdesign.map(job => { const status = job.conclusion === 'success' ? '✅' : '❌'; return `| ${job.name} | ${status} | [Open](${job.html_url}) |` From 90f94a1db2dc1696edae79b6916f14a8c17ee883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sat, 8 Feb 2025 15:24:01 +0800 Subject: [PATCH 17/19] chore: ci --- .github/workflows/test-component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-component.yml b/.github/workflows/test-component.yml index d320a8e9e8..4dd31b4403 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/test-component.yml @@ -208,7 +208,7 @@ jobs: const comment =` # TDesign Component Ecosystem CI [Open](${run_url}) | Component | Status | Job | - | :-------: | :----: | :--: | + | --------- | :----: | :--: | ${tdesign.map(job => { const status = job.conclusion === 'success' ? '✅' : '❌'; return `| ${job.name} | ${status} | [Open](${job.html_url}) |` From 1278a51709fc2b3759bac8857dd20cb863231658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sat, 8 Feb 2025 17:10:43 +0800 Subject: [PATCH 18/19] chore: update name --- ...st-component.yml => tdesign-component-repositories-ci.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{test-component.yml => tdesign-component-repositories-ci.yml} (98%) diff --git a/.github/workflows/test-component.yml b/.github/workflows/tdesign-component-repositories-ci.yml similarity index 98% rename from .github/workflows/test-component.yml rename to .github/workflows/tdesign-component-repositories-ci.yml index 4dd31b4403..07b3f99243 100644 --- a/.github/workflows/test-component.yml +++ b/.github/workflows/tdesign-component-repositories-ci.yml @@ -1,4 +1,4 @@ -name: TEST_COMPONENT +name: TDesign Component Repositories CI Test on: workflow_run: @@ -206,7 +206,7 @@ jobs: const run_url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` const comment =` - # TDesign Component Ecosystem CI [Open](${run_url}) + # TDesign Component Repositories CI Test [Open](${run_url}) | Component | Status | Job | | --------- | :----: | :--: | ${tdesign.map(job => { From 4a076ec1657734d2e3cb77c3efa1f5d7e5fe56e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Sat, 8 Feb 2025 17:26:49 +0800 Subject: [PATCH 19/19] chore: update name --- .github/workflows/tdesign-component-repositories-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tdesign-component-repositories-ci.yml b/.github/workflows/tdesign-component-repositories-ci.yml index 07b3f99243..247ace5622 100644 --- a/.github/workflows/tdesign-component-repositories-ci.yml +++ b/.github/workflows/tdesign-component-repositories-ci.yml @@ -215,7 +215,7 @@ jobs: console.log(job.name, process.env[job.name]); }).join("\n")} - + ` core.setOutput('comment', comment); @@ -226,4 +226,4 @@ jobs: token: ${{ secrets.TDESIGN_BOT_TOKEN }} number: ${{needs.pr-context.outputs.pr_id}} body: ${{ steps.report.outputs.comment }} - body-include: '' \ No newline at end of file + body-include: '' \ No newline at end of file