Skip to content

fix(errors): add CANCELLED and RESPONSE_VALIDATION_ERROR to LILY_ERROR_CODES #1099

fix(errors): add CANCELLED and RESPONSE_VALIDATION_ERROR to LILY_ERROR_CODES

fix(errors): add CANCELLED and RESPONSE_VALIDATION_ERROR to LILY_ERROR_CODES #1099

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 146, Col: 3): 'docs' is already defined
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run format:check
- run: npm run build
- run: npm run test
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- run: npm run docs
- name: Verify committed API docs are in sync with the source
run: |
if ! git diff --exit-code -- docs/api; then
echo "::error::docs/api is out of date with the source. Run 'npm run docs' and commit the regenerated output."
exit 1
fi
if [ -n "$(git status --porcelain docs/api)" ]; then
echo "::error::docs/api has untracked or modified files. Run 'npm run docs' and commit the regenerated output."
git status --porcelain docs/api
exit 1
fi
example:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run example
- name: Lint
run: npm run lint
- name: Format check
run: npm run format:check
- name: Typecheck
run: npm run typecheck
- name: Typecheck Examples
run: npm run typecheck:examples
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/coverage-final.json
flags: unittests
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/coverage-final.json
fail_ci_if_error: false
if: matrix.node-version == '20'
- name: Upload coverage to Codecov
if: matrix.node-version == 22
uses: codecov/codecov-action@v5
with:
files: ./coverage/coverage-final.json
fail_ci_if_error: true
use_oidc: true
- name: Verify npm pack contents
run: |
PACK_CONTENTS=$(npm pack --dry-run --json)
echo "$PACK_CONTENTS" | jq -e '.[0].files | map(.path) | sort' > /tmp/pack-files.json
# Expected files: package.json, README.md, LICENSE, CHANGELOG.md, docs/**, and dist/**
# Fail if src/, tests/, coverage/, .env, or other dev artifacts are present
UNEXPECTED=$(jq -r '.[] | select(
test("^package\\.json$") or
test("^README\\.md$") or
test("^LICENSE$") or
test("^CHANGELOG\\.md$") or
test("^docs/") or
test("^dist/")
| not)' /tmp/pack-files.json)
if [ -n "$UNEXPECTED" ]; then
echo "::error::Unexpected files in npm tarball:"
echo "$UNEXPECTED"
exit 1
fi
# Verify essential files are present
ESSENTIAL_MISSING=$(echo '["package.json","README.md","LICENSE","CHANGELOG.md"]' | jq -r '.[]' | while read f; do
if ! jq -e ".[] | select(. == \"$f\")" /tmp/pack-files.json > /dev/null 2>&1; then
echo "$f"
fi
done)
if [ -n "$ESSENTIAL_MISSING" ]; then
echo "::error::Missing essential files in npm tarball:"
echo "$ESSENTIAL_MISSING"
exit 1
fi
echo "✅ npm pack contents verified successfully"
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- run: npm run docs
- name: Check for uncommitted docs diff
run: |
if [ -n "$(git status --porcelain docs/api)" ]; then
echo "::error::Generated typedoc documentation under docs/api/ is out of sync with code. Please run 'npm run docs' locally and commit the changes."
git diff docs/api
exit 1
fi