Skip to content

fix(ci): unique SARIF category per security workflow #318

fix(ci): unique SARIF category per security workflow

fix(ci): unique SARIF category per security workflow #318

name: validate
on:
pull_request:
branches: [main]
push:
branches: [main]
paths:
- "apps/ui/**"
- ".github/workflows/apps-ui-validate.yml"
concurrency:
group: apps-ui-validate-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
validate:
defaults:
run:
working-directory: apps/ui
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Detect relevant changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
code:
- 'apps/ui/**'
- '.github/workflows/apps-ui-validate.yml'
- name: Set up Bun
if: steps.filter.outputs.code == 'true'
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
- name: Install
if: steps.filter.outputs.code == 'true'
run: bun install --frozen-lockfile
- name: Dependency audit
if: steps.filter.outputs.code == 'true'
run: bun audit --audit-level high
- name: Lint + format + typecheck
if: steps.filter.outputs.code == 'true'
run: bun run check
- name: Unit + integration tests
if: steps.filter.outputs.code == 'true'
run: bun run test:ci
- name: Upload coverage to Codecov
if: steps.filter.outputs.code == 'true'
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
files: apps/ui/coverage/lcov.info
flags: ui
name: ui-coverage
fail_ci_if_error: false
# CODECOV_TOKEN is required for private repos; for public repos
# uploads work tokenless.
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build
if: steps.filter.outputs.code == 'true'
run: bun run build
- name: Bundle size budget
if: steps.filter.outputs.code == 'true'
run: bun run size:check
- name: Modulepreload size coverage
if: steps.filter.outputs.code == 'true'
run: bun run size:check:modulepreload
- name: Lighthouse CI (a11y + best-practices + SEO + perf budgets)
if: steps.filter.outputs.code == 'true'
run: bunx lhci autorun
- name: Build Storybook
if: steps.filter.outputs.code == 'true'
run: bun run build-storybook
- name: Upload dist
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist
retention-days: 1
# NOTE: Playwright report upload lives in full-stack-smoke.yml in the
# infra/compose repo, where E2E actually runs.
- name: Upload Storybook
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: storybook-static
path: storybook-static
retention-days: 1
- name: Upload Lighthouse reports
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lighthouse-reports
path: .lighthouseci
retention-days: 7