Skip to content

Add MIT LICENSE file #1203

Add MIT LICENSE file

Add MIT LICENSE file #1203

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Lint & Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm data:generate
- run: pnpm lint
- run: pnpm typecheck
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm data:generate
# The published-tarball integration test runs in the dedicated `tarball`
# job below (built once, consumed across the Node matrix), so it is
# excluded here to avoid a redundant per-leg build.
- name: Run tests
run: pnpm exec vitest run --exclude '**/publishedTarball.test.ts'
if: matrix.node-version != 22
- name: Run tests with coverage
run: pnpm exec vitest run --coverage --exclude '**/publishedTarball.test.ts'
if: matrix.node-version == 22
- uses: actions/upload-artifact@v6
if: matrix.node-version == 22
with:
name: coverage
path: coverage/
- name: Upload coverage reports to Codecov
if: matrix.node-version == 22
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: medelman17/eyecite-ts
build:
name: Build & Size Check
needs: [quality, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm size
- name: Verify dist artifacts
run: |
test -f dist/index.mjs
test -f dist/data/index.mjs
test -f dist/annotate/index.mjs
- name: Pack tarball
run: |
mkdir -p pack
npm pack --pack-destination pack
- name: Upload tarball artifact
uses: actions/upload-artifact@v6
with:
name: tarball
path: pack/*.tgz
retention-days: 1
tarball:
name: Tarball consumer (Node ${{ matrix.node-version }})
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Download packed tarball
uses: actions/download-artifact@v7
with:
name: tarball
path: pack
- name: Resolve tarball path
id: tarball
run: echo "path=$(ls "$PWD"/pack/*.tgz)" >> "$GITHUB_OUTPUT"
# Consume the once-built (Node 20+) artifact on every supported Node,
# including Node 18 — verifies the published package actually loads there.
- name: Verify published tarball loads
run: pnpm exec vitest run tests/integration/publishedTarball.test.ts
env:
EYECITE_TARBALL: ${{ steps.tarball.outputs.path }}