Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .githooks/pre-push

This file was deleted.

263 changes: 8 additions & 255 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,266 +15,19 @@ permissions:
contents: read

jobs:
lint:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

# Type-aware rules resolve a sibling package through its built types, so ui-vue's imports
# from ui-runtime/core are error-typed without this and no-unsafe-* fires on every one.
- name: Build packages
run: npm run build

- name: Lint sources, styles, markup, and data
run: npm run lint:all

- name: Check formatting
run: npm run format:check

typecheck:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Typecheck workspaces
run: npm run typecheck

- name: Typecheck documented examples
run: npm run check:docs:examples

contracts:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
- uses: actions/checkout@v7
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Check repository contracts
run: npm run check:repository-contracts

- name: Check CodeMonster UI contracts, accessibility, and visual fixtures
run: npm run test:ui

- name: Run release preparation tests
run: npm run test:release-prep

- name: Check that every verify step runs in CI
run: npm run check:verify-coverage

source-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

# The suite hides dist itself; the build is still needed for its other output, such as
# generated CSS that some workspaces' own tests read back.
- name: Build packages
run: npm run build

- name: Run workspace tests without build output
run: npm run test:ci-like

packaging:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Check package contracts
run: npm run check:package-contracts

- name: Check package size budgets
run: npm run check:ui-package-budgets

- name: Check consumer tree shaking
run: npm run check:consumer-tree-shaking

- name: Dry-run publish artifacts
run: npm run pack:all:dry-run

packed-consumers:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Consume packed tarballs with npm, pnpm, and yarn
run: npm run check:packed-consumers

hygiene:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Check that a clean install stays clean
run: npm run check:clean-install

- name: Audit release dependencies
run: npm run audit:release

visual:
runs-on: macos-26
env:
CHROME_FOR_TESTING_VERSION: 151.0.7922.138

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Install pinned Chrome for visual checks
run: |
chrome_for_testing_path="${RUNNER_TEMP}/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"
curl --fail --location --retry 3 --silent --show-error \
"https://storage.googleapis.com/chrome-for-testing-public/${CHROME_FOR_TESTING_VERSION}/mac-arm64/chrome-mac-arm64.zip" \
--output "${RUNNER_TEMP}/chrome-for-testing.zip"
unzip -q "${RUNNER_TEMP}/chrome-for-testing.zip" -d "${RUNNER_TEMP}"
"${chrome_for_testing_path}" --version

- name: Verify cross-platform adapter visuals
- run: npm ci
- name: Check changed workspaces
env:
CROSS_PLATFORM_CAPTURE: ${{ runner.temp }}/codemonster-cross-platform-current
CROSS_PLATFORM_VANILLA_DIFF: ${{ runner.temp }}/codemonster-cross-platform-vanilla-diff
CROSS_PLATFORM_VUE_DIFF: ${{ runner.temp }}/codemonster-cross-platform-vue-diff
run: |
set -euo pipefail
chrome_for_testing_path="${RUNNER_TEMP}/chrome-mac-arm64/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing"

npm run visual:cross-platform:serve -- --port=5176 > "${RUNNER_TEMP}/codemonster-cross-platform-vite.log" 2>&1 &
adapter_pid=$!
"${chrome_for_testing_path}" --headless=new --remote-debugging-port=9226 --user-data-dir="${RUNNER_TEMP}/codemonster-showcase-chrome" --disable-gpu --no-first-run --no-default-browser-check about:blank > "${RUNNER_TEMP}/codemonster-showcase-chrome.log" 2>&1 &
chrome_pid=$!

cleanup() {
kill "${adapter_pid}" "${chrome_pid}" 2>/dev/null || true
}
trap cleanup EXIT

for attempt in {1..60}; do
if curl --fail --silent 'http://127.0.0.1:5176/?case=button-default&platform=vue&theme=light' >/dev/null && curl --fail --silent http://127.0.0.1:9226/json/version >/dev/null; then
break
fi
if [ "${attempt}" -eq 60 ]; then
cat "${RUNNER_TEMP}/codemonster-cross-platform-vite.log"
cat "${RUNNER_TEMP}/codemonster-showcase-chrome.log"
exit 1
fi
sleep 1
done

npm run visual:cross-platform:capture -- --origin=http://127.0.0.1:5176 --output="${CROSS_PLATFORM_CAPTURE}" --label=ci-actual-adapters
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vue" --diff="${CROSS_PLATFORM_VUE_DIFF}" --threshold=4
node scripts/visual/compare-showcase.mjs --baseline=visual-baselines/vueforge-cross-platform --current="${CROSS_PLATFORM_CAPTURE}/vanilla" --diff="${CROSS_PLATFORM_VANILLA_DIFF}" --threshold=4

CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-visual.json" node scripts/visual/check-vanilla-parity.mjs
CHROME_PATH="${chrome_for_testing_path}" CM_PARITY_REPORT="${RUNNER_TEMP}/codemonster-pair-behavior.json" CM_PARITY_BEHAVIOR=1 node scripts/visual/check-vanilla-parity.mjs

- name: Upload cross-platform visual differences
if: failure()
uses: actions/upload-artifact@v7
with:
name: codemonster-cross-platform-visual-diff
path: |
${{ runner.temp }}/codemonster-cross-platform-current
${{ runner.temp }}/codemonster-cross-platform-vue-diff
${{ runner.temp }}/codemonster-cross-platform-vanilla-diff
${{ runner.temp }}/codemonster-pair-*.json
${{ runner.temp }}/codemonster-cross-platform-vite.log
${{ runner.temp }}/codemonster-showcase-chrome.log
if-no-files-found: ignore
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: npm run check -- "$BASE_SHA" --smoke
Loading
Loading