From 2502a932523a0c185aab6ef3e2784ec0a1bbbbf3 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sat, 29 Mar 2025 21:55:34 +0800 Subject: [PATCH 1/2] ci: enable codecov action --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08699be..63ff8b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: true jobs: - default: + ci: name: Lint and Test with Node.js ${{ matrix.node }} on ${{ matrix.os }} strategy: matrix: @@ -41,9 +41,14 @@ jobs: - name: Build and Typecov run: yarn run-s build typecov env: - EFF_NO_LINK_RULES: true PARSER_NO_WATCH: true - name: Lint and Test if: ${{ matrix.node != 16}} run: yarn run-s lint test + + - name: Codecov + if: ${{ matrix.node != 16}} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} From e9f77bd8ca7fb6c5c124d71e93acbb33e5190726 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sat, 29 Mar 2025 22:15:02 +0800 Subject: [PATCH 2/2] ci: stop running on Node 16 --- .github/workflows/ci.yml | 14 +++-------- tests/e2e/e2e.spec.ts | 54 ++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63ff8b9..34d07a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: node: - - 16 - 18 - 20 - 22 @@ -24,8 +23,6 @@ jobs: - macos-latest fail-fast: false runs-on: ${{ matrix.os }} - env: - YARN_IGNORE_NODE: 1 steps: - uses: actions/checkout@v4 @@ -38,17 +35,14 @@ jobs: - name: Install Dependencies run: yarn --immutable - - name: Build and Typecov - run: yarn run-s build typecov + - name: Build, Lint and Test + run: | + yarn build + yarn run-p lint test typecov env: PARSER_NO_WATCH: true - - name: Lint and Test - if: ${{ matrix.node != 16}} - run: yarn run-s lint test - - name: Codecov - if: ${{ matrix.node != 16}} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/tests/e2e/e2e.spec.ts b/tests/e2e/e2e.spec.ts index 680a693..4fc19e5 100644 --- a/tests/e2e/e2e.spec.ts +++ b/tests/e2e/e2e.spec.ts @@ -4,6 +4,8 @@ import path from 'node:path' import { tryFile } from '@pkgr/core' import { exec } from 'tinyexec' +const TIMEOUT = 30_000 + describe('e2e cases', async () => { const { dirname } = import.meta @@ -26,31 +28,35 @@ describe('e2e cases', async () => { }) } - it('should exec eslint successfully', async () => { - const eslintConfig = tryFile('eslint.config.js', false, absoluteDir) - expect( - await exec( - 'yarn', - [ - 'eslint', - ...(eslintConfig - ? ['-c', eslintConfig] - : ['--ignore-pattern', '!.dot']), - '--ext', - 'cjs,cts,js,jsx,mjs,mts,ts,tsx', - '--report-unused-disable-directives', - absoluteDir, - ], - { - nodeOptions: { - env: { - ESLINT_USE_FLAT_CONFIG: eslintConfig ? undefined : 'false', - NODE_OPTIONS: '--no-warnings=ESLintRCWarning', + it( + `should exec eslint successfully > ${dirName}`, + async () => { + const eslintConfig = tryFile('eslint.config.js', false, absoluteDir) + expect( + await exec( + 'yarn', + [ + 'eslint', + ...(eslintConfig + ? ['-c', eslintConfig] + : ['--ignore-pattern', '!.dot']), + '--ext', + 'cjs,cts,js,jsx,mjs,mts,ts,tsx', + '--report-unused-disable-directives', + absoluteDir, + ], + { + nodeOptions: { + env: { + ESLINT_USE_FLAT_CONFIG: eslintConfig ? undefined : 'false', + NODE_OPTIONS: '--no-warnings=ESLintRCWarning', + }, }, }, - }, - ), - ).toMatchSnapshot(dirName) - }) + ), + ).toMatchSnapshot() + }, + TIMEOUT, + ) } })