Skip to content

ci: add publint + are-the-types-wrong package check, and Dependabot #74

ci: add publint + are-the-types-wrong package check, and Dependabot

ci: add publint + are-the-types-wrong package check, and Dependabot #74

Workflow file for this run

name: CI
on:
push:
branches: [main, next]
pull_request:
branches: [main, next]
permissions:
contents: write # <-- allows pushing tags/commits
issues: write # <-- needed for GitHub release notes
pull-requests: write
id-token: write # <-- required for OIDC/Trusted Publisher
jobs:
build:
runs-on: ubuntu-latest
if: >
!contains(github.event.head_commit.message, '--skip-ci')
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22
- name: Setup Bun latest
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Type check (tsc)
run: bun run types
- name: Type check (tsgo)
run: bun run typesgo
- name: Lint (eslint)
run: bun run lint
- name: Source tests
run: bun test ./src --coverage --coverage-reporter=text --coverage-reporter=lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: ./coverage/lcov.info
slug: devp0nt/error0
use_oidc: true # tokenless: GitHub OIDC + the Codecov GitHub App (no stored token)
fail_ci_if_error: false # coverage is informational for now — never fail CI on it
- name: Build
run: bun run build
- name: Check published package (publint + are-the-types-wrong)
run: bun run check:package
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-files
path: |
dist/
scripts/
package.json
retention-days: 1
smoke:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 20
- 22
- 24
steps:
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-files
path: .
- name: Smoke test built package
run: node scripts/smoke.mjs
release:
needs: smoke
runs-on: ubuntu-latest
if: >
github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next') &&
!contains(github.event.head_commit.message, '--skip-ci')
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # semantic-release requires full history
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org
scope: '@devp0nt'
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: build-files
path: .
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release