Skip to content

chore: migrate npm to pnpm, add CI and release workflows #4

chore: migrate npm to pnpm, add CI and release workflows

chore: migrate npm to pnpm, add CI and release workflows #4

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@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm exec vitest run
if: matrix.node-version != 22
- name: Run tests with coverage
run: pnpm exec vitest run --coverage
if: matrix.node-version == 22
- uses: actions/upload-artifact@v4
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/eyecitets
build:
name: Build & Size Check
needs: [quality, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
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