diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4c1d652 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + - run: npm ci + - run: npm run check + - run: npm run build + - run: npm test + - run: npm run smoke + - run: npm run package:smoke diff --git a/package.json b/package.json index 5772095..bc4440f 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,12 @@ "lint": "eslint src --ext .ts", "format": "prettier --write src", "validate": "bash scripts/validate.sh", - "smoke": "npm run build && node dist/cli.js fixtures/mixed --detail --min-coverage 40", "test": "vitest run --coverage", "test:watch": "vitest", - "prepublishOnly": "npm run build" + "prepublishOnly": "npm run build", + "release:check": "npm run check && npm test && npm run smoke && npm run package:smoke", + "package:smoke": "npm pack --dry-run", + "smoke": "npm run build && node dist/cli.js --help && node dist/cli.js fixtures --format text" }, "keywords": [ "typescript", diff --git a/src/cli.test.ts b/src/cli.test.ts index 690bfa7..026a050 100644 --- a/src/cli.test.ts +++ b/src/cli.test.ts @@ -39,8 +39,7 @@ describe('CLI integration', () => { }); it('scans current directory when no argument', () => { - // This should scan the project's own src files - const output = execSync(`cd /Users/roger/Developer/my-opensource/typegap && ${cli}`, { encoding: 'utf-8' }); + const output = execSync(cli, { encoding: 'utf-8', cwd: process.cwd() }); expect(output).toContain('Coverage'); }); diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..b41a6df --- /dev/null +++ b/src/version.ts @@ -0,0 +1 @@ +export const version = "0.1.0";