From 0dc1db1548609964d030a5c39dae216a234ec44d Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 25 Nov 2025 12:01:17 +0800 Subject: [PATCH 1/5] Refactor CI workflow and add test job --- .github/workflows/main.yml | 118 ++----------------------------------- 1 file changed, 5 insertions(+), 113 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09638c3..f8482b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,114 +1,6 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - +name: ✅ test +on: [push, pull_request] jobs: - setup: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - uses: actions/setup-node@v1 - with: - node-version: '18' - - - name: cache package-lock.json - uses: actions/cache@v3 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts - - - name: hack for singe file - run: | - if [ ! -d "package-temp-dir" ]; then - mkdir package-temp-dir - fi - cp package-lock.json package-temp-dir - - - name: cache node_modules - id: node_modules_cache_id - uses: actions/cache@v3 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: install - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci - - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - 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: lint - run: npm run lint - - needs: setup - - compile: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - 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 - - needs: setup - - coverage: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@master - - - 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: coverage - run: npm test -- --coverage && bash <(curl -s https://codecov.io/bash) - - needs: setup + test: + uses: react-component/rc-test/.github/workflows/test-utoo.yml@main + secrets: inherit From 3ebc33476f9762a577d1159f6b6d3b3550dc1315 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 25 Nov 2025 12:02:34 +0800 Subject: [PATCH 2/5] Update now.json to use umijs framework --- now.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/now.json b/now.json index 7b2f649..cc12e40 100644 --- a/now.json +++ b/now.json @@ -1,11 +1,3 @@ { - "version": 2, - "name": "rc-overflow", - "builds": [ - { - "src": "package.json", - "use": "@vercel/static-build", - "config": { "distDir": "docs-dist" } - } - ] -} \ No newline at end of file + "framework": "umijs" +} From ed3183e46795301e3b37a15588929485583d6d04 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 25 Nov 2025 12:09:20 +0800 Subject: [PATCH 3/5] Update .dumirc.ts --- .dumirc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dumirc.ts b/.dumirc.ts index b7bb3f8..9d2093c 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -8,7 +8,7 @@ export default defineConfig({ logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, exportStatic: {}, - outputPath: 'docs-dist', + outputPath: '.doc', base: isGitPagesSite ? `/rc-overflow/` : `/`, publicPath: isGitPagesSite ? `/rc-overflow/` : `/`, styles: [ From b2e6107988a5408d994b981f002ffde63fff893f Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 25 Nov 2025 12:09:53 +0800 Subject: [PATCH 4/5] Rename now.json to vercel.json --- now.json => vercel.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename now.json => vercel.json (100%) diff --git a/now.json b/vercel.json similarity index 100% rename from now.json rename to vercel.json From 55819998e57627f4d57bd46f1dbc414175bde654 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 25 Nov 2025 12:10:16 +0800 Subject: [PATCH 5/5] Update docs deploy script to use .doc directory --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98b548f..324b8bc 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "scripts": { "start": "dumi dev", "docs:build": "dumi build", - "docs:deploy": "gh-pages -d docs-dist", + "docs:deploy": "gh-pages -d .doc", "compile": "father build", "prepare": "dumi setup", "deploy": "npm run docs:build && npm run docs:deploy",