From 0cfd4d15eb5e94a8924e726c95c91ddb00d3d455 Mon Sep 17 00:00:00 2001 From: luojiyin Date: Wed, 4 Nov 2026 12:06:45 +0800 Subject: [PATCH 1/3] ci: cache pnpm dependencies and reduce redundant workflows --- .github/workflows/build.yml | 43 ++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55859c6..8d93738 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,14 @@ name: build -on: [pull_request, push] +on: + pull_request: + push: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true permissions: contents: read @@ -15,16 +23,18 @@ jobs: - name: Checkout uses: actions/checkout@v6.0.2 - - name: Setup Node.js environment - uses: actions/setup-node@v6.3.0 - with: - node-version: ${{ matrix.node-version }} - - name: Setup PNPM uses: pnpm/action-setup@v6.0.8 with: version: 11.27.1 + - name: Setup Node.js environment + uses: actions/setup-node@v6.3.0 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + cache-dependency-path: pnpm-lock.yaml + - name: Install modules and build projects run: pnpm install --frozen-lockfile && pnpm run build @@ -52,25 +62,24 @@ jobs: Lint: runs-on: ubuntu-latest - strategy: - matrix: - node-version: ['20', '22', '24'] steps: - name: Checkout uses: actions/checkout@v6.0.2 - - name: Setup Node.js environment - uses: actions/setup-node@v6.3.0 - with: - node-version: ${{ matrix.node-version }} - - name: Setup PNPM uses: pnpm/action-setup@v6.0.8 with: version: 11.27.1 - - name: Install modules and build projects - run: pnpm install --frozen-lockfile && pnpm run build + - name: Setup Node.js environment + uses: actions/setup-node@v6.3.0 + with: + node-version: '22' + cache: pnpm + cache-dependency-path: pnpm-lock.yaml - - name: Run tests + - name: Install modules + run: pnpm install --frozen-lockfile + + - name: Run lint run: pnpm run lint From 99d8086c512b766b79e66c3e5150e509686b0b81 Mon Sep 17 00:00:00 2001 From: luojiyin Date: Wed, 4 Nov 2026 12:08:35 +0800 Subject: [PATCH 2/3] ci: use standalone pnpm for Node 20 tests --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d93738..9424579 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: uses: pnpm/action-setup@v6.0.8 with: version: 11.27.1 + standalone: true - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 From f1a05da9fc36f2db1eea67e89d6b1ff61a6fc92c Mon Sep 17 00:00:00 2001 From: luojiyin Date: Wed, 4 Nov 2026 13:15:08 +0800 Subject: [PATCH 3/3] chore: drop Node.js 20 support --- .github/workflows/build.yml | 3 +-- README.md | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9424579..2cea59b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ['20', '22', '24'] + node-version: ['22', '24'] steps: - name: Checkout uses: actions/checkout@v6.0.2 @@ -27,7 +27,6 @@ jobs: uses: pnpm/action-setup@v6.0.8 with: version: 11.27.1 - standalone: true - name: Setup Node.js environment uses: actions/setup-node@v6.3.0 diff --git a/README.md b/README.md index 01472a5..c1d8267 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ pnpm run test:mdx3 ### 环境要求 -- Node.js >= 20 +- Node.js >= 22 - pnpm 11(参见 `packageManager` 字段) ```bash diff --git a/package.json b/package.json index d38ee00..a12e121 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "sideEffects": false, "packageManager": "pnpm@11.27.1", "engines": { - "node": ">=20" + "node": ">=22" }, "main": "./dist/lint-md-parser.cjs", "module": "./dist/lint-md-parser.mjs",