Repository navigation
ci: enforce biome (format + complexity + ??= ban) via src/biome.json #366
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master, main, feat/v2, feat/v2-core] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| run_integration: | |
| description: "Run e2e tests against api.telegram.org (requires TEST_TELEGRAM_TOKEN secret)" | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: read | |
| # Cancel in-progress runs for the same PR/branch when a new commit is pushed. | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| typecheck: | |
| name: Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: tsc --noEmit (src) | |
| run: npm run typecheck | |
| - name: tsc --noEmit (test/) | |
| run: npm run typecheck:test | |
| - name: tsc --noEmit (examples/) | |
| run: npm run typecheck:examples | |
| - name: Core stays Node-free (lint:core) | |
| run: npm run lint:core | |
| - name: Core bundles edge-safe (check:edge) | |
| run: npm run check:edge | |
| - name: Formatting is clean (lint:format) | |
| run: npm run lint:format | |
| unit-bun: | |
| name: Unit tests (Bun) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Run unit tests with Bun | |
| run: npm run test | |
| unit-node: | |
| name: Unit tests (Node ${{ matrix.node }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ["22", "24", "26"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install dependencies | |
| run: npm install --no-audit --no-fund | |
| - name: Run unit tests with Node | |
| run: npm run test:node:unit | |
| build: | |
| name: Build (dist) | |
| runs-on: ubuntu-latest | |
| needs: typecheck | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Build | |
| run: npm run build | |
| - name: Verify dist artefacts | |
| run: | | |
| test -f dist/core/index.js | |
| test -f dist/core/index.d.ts | |
| test -f dist/node/index.js | |
| test -f dist/node/index.d.ts | |
| test -f dist/types/index.js | |
| test -f dist/types/index.d.ts | |
| integration: | |
| name: E2E tests (api.telegram.org) | |
| runs-on: ubuntu-latest | |
| needs: typecheck | |
| if: github.event_name == 'workflow_dispatch' && inputs.run_integration | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile || bun install | |
| - name: Run e2e tests | |
| env: | |
| TEST_TELEGRAM_TOKEN: ${{ secrets.TEST_TELEGRAM_TOKEN }} | |
| TEST_GROUP_ID: ${{ secrets.TEST_GROUP_ID }} | |
| TEST_USER_ID: ${{ secrets.TEST_USER_ID }} | |
| run: npm run test:e2e |