Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/plugin/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin/console/tests/discovery/enumerate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function indexSource(home: string, file: string): PluginSource {

describe('parseGithubUrl', () => {
it('parses bare and .git URLs', () => {
assert.deepEqual(parseGithubUrl('https://github.com/vlln/whale-girl'), { owner: 'dsh-external', repo: 'whale-girl' })
assert.deepEqual(parseGithubUrl('https://github.com/vlln/whale-girl'), { owner: 'dsh-external', repo: 'whale-girl' })
assert.deepEqual(parseGithubUrl('https://github.com/vlln/whale-girl'), { owner: 'vlln', repo: 'whale-girl' })
assert.deepEqual(parseGithubUrl('https://github.com/vlln/whale-girl.git'), { owner: 'vlln', repo: 'whale-girl' })
})
it('rejects non-github URLs', () => {
assert.equal(parseGithubUrl('https://example.com/x'), null)
Expand Down