git-subtree-dir: aiui git-subtree-mainline:0c4826f8ccgit-subtree-split:e30ac1d106
132 lines
3.7 KiB
YAML
132 lines
3.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, development]
|
|
pull_request:
|
|
branches: [main, development]
|
|
|
|
jobs:
|
|
lint-typecheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm typecheck
|
|
- run: pnpm lint
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm test
|
|
|
|
bundle-size:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm build
|
|
- name: Check bundle size
|
|
run: |
|
|
BUNDLE_SIZE=$(find packages/app/dist/assets -name '*.js' -o -name '*.css' | xargs gzip -c | wc -c)
|
|
BUNDLE_KB=$((BUNDLE_SIZE / 1024))
|
|
echo "Bundle size: ${BUNDLE_KB}KB gzipped"
|
|
if [ "$BUNDLE_KB" -gt 250 ]; then
|
|
echo "::error::Bundle size ${BUNDLE_KB}KB exceeds 250KB budget"
|
|
exit 1
|
|
fi
|
|
echo "Bundle size ${BUNDLE_KB}KB is within 250KB budget"
|
|
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
browser: [chromium, firefox, webkit]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: cd packages/app && npx playwright install --with-deps ${{ matrix.browser }}
|
|
- run: cd packages/app && pnpm test:e2e --project=${{ matrix.browser }}
|
|
|
|
e2e-mobile:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: cd packages/app && npx playwright install --with-deps chromium webkit
|
|
- run: cd packages/app && pnpm test:e2e --project=iphone14 --project=galaxy-s21
|
|
|
|
lighthouse:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm build
|
|
- name: Run Lighthouse
|
|
uses: treosh/lighthouse-ci-action@v12
|
|
with:
|
|
configPath: packages/app/lighthouserc.json
|
|
uploadArtifacts: true
|
|
|
|
dependency-audit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- name: Audit dependencies
|
|
run: pnpm audit --audit-level=critical || true
|
|
- name: Check licenses
|
|
run: |
|
|
npx license-checker --production --onlyAllow 'MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;CC0-1.0;Unlicense;CC-BY-4.0;Python-2.0;BlueOak-1.0.0' --excludePrivatePackages || echo "::warning::Non-approved licenses found"
|