mirror of
https://github.com/bpmforge/kryptkeeper.git
synced 2026-11-23 16:02:01 +00:00
c064db769d
Snapshot of development commit dbdf4e19. The snapshot dry run in ci-pr's docs-check needs a script that stays in the development repository, so here the job runs the site build check and the site tool tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
480 lines
21 KiB
YAML
480 lines
21 KiB
YAML
name: ci-pr
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
merge_group:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-pr-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# Which areas this PR touches (scripts/ci/changed-areas.sh). Each job below
|
|
# runs only for the areas it tests; a change to CI, scripts or build config
|
|
# sets `all`. ci-main still runs everything on every merge to main.
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
outputs:
|
|
go: ${{ steps.areas.outputs.go }}
|
|
ui: ${{ steps.areas.outputs.ui }}
|
|
api: ${{ steps.areas.outputs.api }}
|
|
docker: ${{ steps.areas.outputs.docker }}
|
|
ansible: ${{ steps.areas.outputs.ansible }}
|
|
site: ${{ steps.areas.outputs.site }}
|
|
docs: ${{ steps.areas.outputs.docs }}
|
|
all: ${{ steps.areas.outputs.all }}
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
with:
|
|
fetch-depth: 0
|
|
- id: areas
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
run: |
|
|
set -euo pipefail
|
|
# No base (merge queue, manual run) means test everything.
|
|
if [ -z "$BASE_SHA" ]; then
|
|
printf '%s=true\n' go ui api docker ansible site docs ci all | tee -a "$GITHUB_OUTPUT"
|
|
else
|
|
bash scripts/ci/changed-areas.sh "$BASE_SHA" | tee -a "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
# Clear-cut slop in the lines this PR adds (scripts/ci/check-slop.py).
|
|
slop-check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
needs: [changes]
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
with:
|
|
fetch-depth: 0
|
|
- env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -n "$BASE_SHA" ]; then python3 scripts/ci/check-slop.py "$BASE_SHA"; else echo "no PR base; skipped"; fi
|
|
|
|
# Docs and site: every relative link in what ships publicly resolves, nothing
|
|
# private leaks, and the site builds and passes its own tests.
|
|
docs-check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.docs == 'true' || needs.changes.outputs.site == 'true' || needs.changes.outputs.all == 'true' }}
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- run: |
|
|
set -euo pipefail
|
|
node site/tools/build.mjs --check
|
|
node --test site/tools/*.test.mjs
|
|
# The snapshot script stays in the development repository (.publicignore),
|
|
# so on the public repository this job checks the site only.
|
|
if [ -f scripts/release/publish-snapshot.sh ]; then
|
|
KK_SRC_REPO="$PWD" KK_SRC_COMMIT=HEAD bash scripts/release/publish-snapshot.sh "$RUNNER_TEMP/public-snapshot" | tail -5
|
|
fi
|
|
|
|
protocol-integration-harness:
|
|
name: Protocol+Integration harness
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Run protocol + integration suites via harness
|
|
run: bash scripts/test/run.sh --suite protocol --suite integration
|
|
|
|
runtime-smoke-harness:
|
|
name: Runtime smoke (test harness)
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.docker == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Run smoke suite via harness (auth matrix)
|
|
env:
|
|
KRYPTKEEPER_SMOKE_MODE: local
|
|
run: bash scripts/test/run.sh --suite smoke
|
|
|
|
profile-lint:
|
|
name: Certificate profile lint (pkilint + zlint)
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
env:
|
|
# CLIs only, never Go module dependencies: pkilint is MIT, zlint Apache-2.0.
|
|
PKILINT_VERSION: 0.13.3
|
|
ZLINT_VERSION: v3.7.2
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: false
|
|
- name: Install pkilint and zlint
|
|
run: |
|
|
set -euo pipefail
|
|
python3 -m venv "$RUNNER_TEMP/lintvenv"
|
|
"$RUNNER_TEMP/lintvenv/bin/pip" install --quiet "pkilint==${PKILINT_VERSION}"
|
|
# Outside the module so go.mod/go.sum stay untouched.
|
|
(cd "$RUNNER_TEMP" && GOBIN="$RUNNER_TEMP/lintbin" go install "github.com/zmap/zlint/v3/cmd/zlint@${ZLINT_VERSION}")
|
|
- name: Issue every profile and lint it
|
|
run: |
|
|
set -euo pipefail
|
|
PKILINT_BIN_DIR="$RUNNER_TEMP/lintvenv/bin" ZLINT_BIN="$RUNNER_TEMP/lintbin/zlint" \
|
|
bash scripts/lint/profile-lint.sh
|
|
|
|
lint-static:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.ui == 'true' || needs.changes.outputs.api == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Setup Node
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version-file: ui/.nvmrc
|
|
cache: npm
|
|
cache-dependency-path: ui/package-lock.json
|
|
- name: Go lint (make lint, golangci-lint v2 pinned per .golangci.yml)
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
run: |
|
|
set -euo pipefail
|
|
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0
|
|
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
|
# PATH updated for subsequent steps in this job via $GITHUB_PATH.
|
|
- name: make lint
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
run: make lint
|
|
- name: Frontend lint
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
run: |
|
|
set -euo pipefail
|
|
npm --prefix ui ci
|
|
npm --prefix ui run lint
|
|
- name: Website in sync with the guide (site/content/hubs.json, docs/site/README.md)
|
|
run: |
|
|
node --test site/tools/content.test.mjs site/tools/release.test.mjs site/tools/payload.test.mjs
|
|
node site/tools/build.mjs --check
|
|
- name: Ensure PyYAML (validate-openapi.sh fails closed without a YAML parser)
|
|
# GitHub's hosted image ships PyYAML; the self-hosted act image does not.
|
|
run: python3 -c 'import yaml' 2>/dev/null || { SUDO=$(command -v sudo || true); $SUDO apt-get update -qq && $SUDO apt-get install -y -qq python3-yaml; }
|
|
- name: OpenAPI drift check (W1-03/G-5)
|
|
if: ${{ hashFiles('docs/openapi.yaml') != '' }}
|
|
run: bash scripts/validate-openapi.sh
|
|
|
|
unit-backend:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
# Six internal/bootstrap shards and the rest of the module, each its own
|
|
# job, so the two runners share the race suite (one runner took 23 min).
|
|
# Every shard 1..6 must be listed for full coverage.
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
part: ["--shard 1/6", "--shard 2/6", "--shard 3/6", "--shard 4/6", "--shard 5/6", "--shard 6/6", "--rest"]
|
|
name: unit-backend (${{ matrix.part }})
|
|
timeout-minutes: 50
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Backend unit tests
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
env:
|
|
# 50m per shard: with two PR runs on the shared runner the bootstrap
|
|
# shards took 27-30 min and one hit the 30m default mid-test
|
|
# (the self-hosted forge run 9007, a docs-only PR); nothing was hung.
|
|
GO_TEST_FLAGS: -race -timeout 40m
|
|
run: |
|
|
set -euo pipefail
|
|
# Same `go test ./... -race`, one slice per matrix job.
|
|
bash scripts/test/go-unit-sharded.sh ${{ matrix.part }}
|
|
- name: Skip marker
|
|
if: ${{ hashFiles('go.mod') == '' }}
|
|
run: echo "No Go module detected; skipping backend unit tests"
|
|
|
|
fips-only:
|
|
name: Go FIPS 140-3 (fips140=only)
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
# The whole keystore suite cannot run under "only" (software store's
|
|
# AES-GCM uses arbitrary IVs), so this is a scoped set. -v output plus
|
|
# TestFIPSOnlyModeIsActiveWhenExpected guard against a vacuous green.
|
|
- name: Approved algorithms and ML-DSA refusal under fips140=only
|
|
env:
|
|
GODEBUG: fips140=only
|
|
KK_EXPECT_FIPS_ONLY: "1"
|
|
run: go test ./internal/keystore/ -run '^(TestFIPSOnly|TestCheckFIPSAlgorithm|TestFIPSPosture|TestRootKeyCustody)' -count=1 -v
|
|
# W31F-05: the PQC issuance refusal tests skip outside their GODEBUG mode;
|
|
# KRYPTKEEPER_REQUIRE_FIPS_TEST=1 turns that skip into a failure.
|
|
- name: PQC issuance refusal under fips140=only
|
|
env:
|
|
GODEBUG: fips140=only
|
|
KRYPTKEEPER_REQUIRE_FIPS_TEST: "1"
|
|
run: go test ./internal/bootstrap -run '^TestIssueRefusal_FIPSOnlyMLDSA$' -count=1 -v
|
|
- name: PQC hybrid issuance refusal under fips140=on
|
|
env:
|
|
GODEBUG: fips140=on
|
|
KRYPTKEEPER_REQUIRE_FIPS_TEST: "1"
|
|
run: go test ./internal/bootstrap -run '^TestIssueRefusal_FIPSHybrid$' -count=1 -v
|
|
|
|
unit-frontend:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.ui == 'true' || needs.changes.outputs.api == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Node
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version-file: ui/.nvmrc
|
|
cache: npm
|
|
cache-dependency-path: ui/package-lock.json
|
|
- name: Frontend unit tests
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
run: |
|
|
set -euo pipefail
|
|
npm --prefix ui ci
|
|
# 20s, not vitest's 5s default: render-heavy tests passed locally but
|
|
# timed out on the runner when several builds shared its CPUs.
|
|
npm --prefix ui run test -- --testTimeout=20000
|
|
# vitest does not type-check; the production build runs tsc -b and
|
|
# caught nothing until a merge left a duplicate interface field.
|
|
(cd ui && npx --no-install tsc -b)
|
|
- name: Skip marker
|
|
if: ${{ hashFiles('ui/package.json') == '' }}
|
|
run: echo "No frontend package detected; skipping frontend unit tests"
|
|
|
|
# W37-06: unit tests and ansible-test sanity for the kryptkeeper.pki collection.
|
|
# The live-hub run (ansible/kryptkeeper/pki/tests/integration/run.sh) needs a
|
|
# compose provider and the image builds, so it stays a manual/release check.
|
|
ansible-collection:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.ansible == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Unit tests and sanity
|
|
run: |
|
|
set -euo pipefail
|
|
python3 -m venv "$RUNNER_TEMP/venv"
|
|
"$RUNNER_TEMP/venv/bin/pip" install --quiet ansible-core pytest cryptography
|
|
pyver="$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
|
|
PATH="$RUNNER_TEMP/venv/bin:$PATH" bash ansible/kryptkeeper/pki/tests/run-checks.sh "$pyver"
|
|
|
|
integration-core:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_DB: kryptkeeper_test
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
# Host port chosen by the engine: fixed host ports collide when one
|
|
# runner executes two of these jobs at once.
|
|
- 5432
|
|
# tmpfs: a throwaway test database needs no durable writes, and
|
|
# fsync on the amd64 runner VM's disk made the Postgres suites ~19x
|
|
# slower than on the Mac runner (~80 synced writes/s).
|
|
options: >-
|
|
--tmpfs /var/lib/postgresql/data:rw
|
|
--health-cmd "pg_isready -U postgres -d kryptkeeper_test"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 10
|
|
redis:
|
|
image: redis:7
|
|
ports:
|
|
- 6379
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 10
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Integration tests
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
env:
|
|
# Engine-assigned host ports, used only when the job runs on the VM
|
|
# (GitHub-hosted); container runners reach the services by name.
|
|
PG_HOST_PORT: ${{ job.services.postgres.ports['5432'] }}
|
|
REDIS_HOST_PORT: ${{ job.services.redis.ports['6379'] }}
|
|
run: |
|
|
set -euo pipefail
|
|
# On a container runner (act_runner) the job is itself a container on
|
|
# the services' network, so the service hostname resolves; a
|
|
# GitHub-hosted job runs on the VM and reaches the published ports.
|
|
if getent hosts postgres >/dev/null 2>&1; then pg=postgres:5432 redis=redis:6379; else pg="127.0.0.1:${PG_HOST_PORT}" redis="127.0.0.1:${REDIS_HOST_PORT}"; fi
|
|
export KRYPTKEEPER_TEST_POSTGRES_DSN="postgres://postgres:postgres@${pg}/kryptkeeper_test?sslmode=disable"
|
|
export DATABASE_URL="$KRYPTKEEPER_TEST_POSTGRES_DSN"
|
|
export REDIS_URL="redis://${redis}/0"
|
|
bash tests/integration/run.sh
|
|
# The live-Postgres tests live beside the code they cover and skip
|
|
# unless KRYPTKEEPER_TEST_POSTGRES_DSN is set; tests/integration has
|
|
# no Go packages, so `go test ./tests/integration/...` matched nothing.
|
|
pkgs=$(grep -rl --include='*_test.go' KRYPTKEEPER_TEST_POSTGRES_DSN ./internal | xargs -n1 dirname | sort -u)
|
|
# -p 1: these packages DROP SCHEMA on the one shared database.
|
|
# No -race here: unit-backend already runs the whole module under
|
|
# -race on every PR, and this job exists for the live-Postgres paths;
|
|
# ci-main keeps -race on this run for coverage on main.
|
|
go test -count=1 -p 1 -timeout 30m $pkgs
|
|
- name: Skip marker
|
|
if: ${{ hashFiles('go.mod') == '' }}
|
|
run: echo "No Go module detected; skipping integration tests"
|
|
|
|
security-baseline:
|
|
needs: [changes]
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
env:
|
|
GOVULNCHECK_VERSION: v1.9.0
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Go
|
|
if: ${{ hashFiles('go.mod') != '' }}
|
|
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
|
|
with:
|
|
go-version-file: go.mod
|
|
# false: the runner mounts persistent kk-gomod and kk-gobuild volumes there;
|
|
# setup-go's cache re-downloaded ~2.7 GB over them on every job.
|
|
cache: false
|
|
- name: Go vulnerability check
|
|
if: ${{ hashFiles('go.mod') != '' && (needs.changes.outputs.go == 'true' || needs.changes.outputs.all == 'true') }}
|
|
run: |
|
|
set -euo pipefail
|
|
go install golang.org/x/vuln/cmd/govulncheck@${GOVULNCHECK_VERSION}
|
|
govulncheck ./...
|
|
- name: Secret scan baseline
|
|
run: |
|
|
set -euo pipefail
|
|
# A line may opt out with a `secret-scan:allow <reason>` marker, so every
|
|
# exemption is a reviewed, greppable decision rather than a looser pattern.
|
|
if grep -R --line-number --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.claude -E "(AKIA[0-9A-Z]{16}|BEGIN (RSA|EC|OPENSSH) PRIVATE KEY|xox[baprs]-)" . | grep -v "secret-scan:allow"; then
|
|
echo "Potential secret pattern detected"
|
|
exit 1
|
|
fi
|
|
echo "No high-signal secret patterns detected"
|
|
|
|
e2e-smoke:
|
|
needs: [changes]
|
|
if: ${{ needs.changes.outputs.go == 'true' || needs.changes.outputs.ui == 'true' || needs.changes.outputs.api == 'true' || needs.changes.outputs.all == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
- name: Setup Node
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version-file: ui/.nvmrc
|
|
cache: npm
|
|
cache-dependency-path: ui/package-lock.json
|
|
- name: E2E smoke
|
|
if: ${{ hashFiles('ui/package.json') != '' }}
|
|
run: |
|
|
set -euo pipefail
|
|
npm --prefix ui ci
|
|
# Probe the declared dependency, not `npm exec playwright`: npm exec
|
|
# downloads the package on demand, so that probe always passed and
|
|
# then ran Playwright over the vitest files.
|
|
if [ -f ui/playwright.config.ts ]; then
|
|
# W33-01: the Playwright suite drives a compose hub (ui/e2e) and lives in
|
|
# ui-e2e.yml; running it here without a hub (and without its config, from
|
|
# the repo root) only re-ran the vitest files under Playwright.
|
|
echo "UI Playwright suite needs a compose hub; it runs in ui-e2e.yml"
|
|
elif node -e 'const p=require("./ui/package.json");process.exit(({...p.dependencies,...p.devDependencies})["@playwright/test"]?0:1)'; then
|
|
npm --prefix ui exec playwright test
|
|
else
|
|
echo "No Playwright dependency found; skipping e2e smoke"
|
|
fi
|
|
- name: Skip marker
|
|
if: ${{ hashFiles('ui/package.json') == '' }}
|
|
run: echo "No frontend package detected; skipping e2e smoke"
|
|
|
|
# The one check to gate merges on: every job this PR needed passed. Jobs
|
|
# skipped because their area did not change count as passed.
|
|
ci-pr-result:
|
|
name: ci-pr result
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
if: ${{ always() }}
|
|
needs: [changes, slop-check, docs-check, protocol-integration-harness, runtime-smoke-harness, profile-lint, lint-static, unit-backend, fips-only, unit-frontend, ansible-collection, integration-core, security-baseline, e2e-smoke]
|
|
steps:
|
|
- env:
|
|
RESULTS: ${{ toJSON(needs) }}
|
|
run: |
|
|
set -euo pipefail
|
|
echo "$RESULTS" | python3 -c '
|
|
import json, sys
|
|
bad = {k: v["result"] for k, v in json.load(sys.stdin).items() if v["result"] not in ("success", "skipped")}
|
|
print("failed or cancelled:", bad if bad else "none")
|
|
sys.exit(1 if bad else 0)'
|