diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3e49646 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + console: + name: console package (build + test) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # 本仓库的历史问题集中在 Windows(.cmd 垫片 spawn、HOME 兜底等), + # 因此 Windows 与 Linux 都跑,避免只在单平台绿。 + os: [ubuntu-latest, windows-latest] + defaults: + run: + working-directory: packages/plugin/console + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + # lockfile 为 pnpm 9 格式(lockfileVersion '9.0'),钉同大版本。 + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: packages/plugin/console/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: pnpm test diff --git a/packages/plugin/console/package.json b/packages/plugin/console/package.json index eda1042..d378e17 100644 --- a/packages/plugin/console/package.json +++ b/packages/plugin/console/package.json @@ -8,7 +8,7 @@ "main": "lib/index.mjs", "scripts": { "build": "tsdown --config tsdown.config.ts", - "test": "TSX_TSCONFIG_PATH=tests/tsconfig.json node --import tsx --test tests/discovery/*.spec.ts" + "test": "cd tests && node --import tsx --test \"**/*.spec.ts\"" }, "exports": { ".": {