openpencil/.github/workflows/ci.yml
Danila Poyarkov fa3d7b8a8f Enable type-aware linting with tsgo in oxlint
Add oxlint-tsgolint dependency and --type-aware --type-check flags.
This replaces the separate tsgo --noEmit step — oxlint now handles
both linting and type checking in a single pass.

Add typescript/no-floating-promises as a warning rule.
2026-03-08 23:02:25 +03:00

96 lines
2.5 KiB
YAML

name: CI
on:
pull_request:
branches: [master]
paths-ignore:
- 'packages/docs/**'
- 'openspec/**'
- '*.md'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Pull LFS files
run: git lfs pull
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- name: Lint & typecheck
run: bun run check
- name: Unit tests
run: bun test tests/engine/
env:
BUN_HEAVY_TESTS: '1'
- name: Copy-paste detection
run: bun run test:dupes
preview:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
environment:
name: preview
url: ${{ steps.deploy.outputs.deployment-url }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- run: bun run build
- uses: cloudflare/wrangler-action@v3
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=openpencil-app --branch=${{ github.head_ref }}
- name: Comment preview URL
uses: actions/github-script@v7
with:
script: |
const url = '${{ steps.deploy.outputs.deployment-url }}';
const marker = '<!-- preview-deploy -->';
const body = `${marker}\n🔗 Preview: ${url}`;
const { data: comments } = await github.rest.issues.listComments({
...context.repo, issue_number: context.issue.number
});
const existing = comments.find(c => c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
...context.repo, comment_id: existing.id, body
});
} else {
await github.rest.issues.createComment({
...context.repo, issue_number: context.issue.number, body
});
}