mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
81 lines
2.6 KiB
YAML
81 lines
2.6 KiB
YAML
name: Frontend checks
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, dev]
|
|
push:
|
|
branches: [main, dev]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build and test
|
|
# Org reusable workflow (Node 24): format check, lint, build, unit tests.
|
|
uses: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-frontend.yaml@main
|
|
with:
|
|
node-version: "24"
|
|
|
|
# Temporary compatibility check for the existing branch-protection context.
|
|
# A repository administrator can remove this only after both rulesets require
|
|
# `Build and test / ci`.
|
|
ci-compatibility:
|
|
name: ci / ci
|
|
needs: build-and-test
|
|
if: ${{ always() }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Propagate build-and-test result
|
|
env:
|
|
BUILD_AND_TEST_RESULT: ${{ needs.build-and-test.result }}
|
|
run: test "${BUILD_AND_TEST_RESULT}" = "success"
|
|
|
|
governance:
|
|
# Repo-owned guarantee that every frontend quality gate runs from this
|
|
# repository, independent of (and in addition to) the reusable workflow.
|
|
# `npm run verify` is the single command that chains: format check, lint
|
|
# (--max-warnings=0), type-check + build, unit tests, then the governance
|
|
# checks in scripts/governance-check.mjs (godfile ratchet + changed-file
|
|
# maintainability gate). If the reusable workflow is later confirmed to run
|
|
# every gate, this job can be slimmed to `npm run governance`.
|
|
#
|
|
# GOVERNANCE_BASE points the changed-file gate at the right diff:
|
|
# PR -> the PR target branch (origin/<base_ref>)
|
|
# push-> the previous commit on the branch (github.event.before)
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GOVERNANCE_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "24"
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run verify
|
|
|
|
visual-regression:
|
|
name: Visual regression
|
|
runs-on: ubuntu-latest
|
|
container: mcr.microsoft.com/playwright:v1.61.1-noble
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "24"
|
|
cache: npm
|
|
- run: npm ci
|
|
- run: npm run test:e2e:visual
|
|
- name: Upload visual diff artifacts
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: visual-regression-diffs
|
|
path: |
|
|
test-results/visual
|
|
playwright-report-visual
|
|
if-no-files-found: ignore
|
|
retention-days: 14
|