|
| 1 | +# SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk> |
| 3 | +# |
| 4 | +# Enterprise trust pipeline — live-service E2E tests. |
| 5 | +# |
| 6 | +# Pulls all 5 trust-tier service images from GHCR (public, no auth required), |
| 7 | +# starts them via selur-compose.yml, waits for health checks, then runs the |
| 8 | +# :live_service E2E suite against the real HTTP endpoints. |
| 9 | +# |
| 10 | +# Triggered manually (workflow_dispatch) or on push to main when trust service |
| 11 | +# sources change. Not on every push — service startup adds ~90s overhead. |
| 12 | + |
| 13 | +name: Trust Pipeline — Live-Service E2E |
| 14 | + |
| 15 | +on: |
| 16 | + workflow_dispatch: |
| 17 | + push: |
| 18 | + branches: [main] |
| 19 | + paths: |
| 20 | + - 'services/**' |
| 21 | + - 'opsm_ex/lib/opsm/trust/**' |
| 22 | + - 'opsm_ex/lib/opsm/clients/**' |
| 23 | + - 'opsm_ex/test/integration/trust_pipeline_live_e2e_test.exs' |
| 24 | + - 'selur-compose.yml' |
| 25 | + - '.github/workflows/trust-pipeline-e2e.yml' |
| 26 | + |
| 27 | +permissions: read-all |
| 28 | + |
| 29 | +concurrency: |
| 30 | + group: trust-pipeline-e2e-${{ github.ref }} |
| 31 | + cancel-in-progress: true |
| 32 | + |
| 33 | +jobs: |
| 34 | + trust-pipeline-e2e: |
| 35 | + name: Trust Pipeline Live E2E |
| 36 | + runs-on: ubuntu-24.04 |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 41 | + with: |
| 42 | + submodules: false |
| 43 | + |
| 44 | + # ----------------------------------------------------------------------- |
| 45 | + # Elixir / BEAM setup |
| 46 | + # ----------------------------------------------------------------------- |
| 47 | + - name: Install Elixir and OTP |
| 48 | + uses: erlef/setup-beam@5a67e1a1dd86cae5e5bef84e2da5060406a66c07 # v1 |
| 49 | + with: |
| 50 | + otp-version: '26.2' |
| 51 | + elixir-version: '1.16.0' |
| 52 | + |
| 53 | + - name: Cache Mix dependencies |
| 54 | + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 |
| 55 | + with: |
| 56 | + path: | |
| 57 | + opsm_ex/deps |
| 58 | + opsm_ex/_build |
| 59 | + key: mix-${{ runner.os }}-${{ hashFiles('opsm_ex/mix.lock') }} |
| 60 | + restore-keys: mix-${{ runner.os }}- |
| 61 | + |
| 62 | + - name: Install Mix dependencies |
| 63 | + working-directory: opsm_ex |
| 64 | + run: mix deps.get |
| 65 | + |
| 66 | + - name: Compile |
| 67 | + working-directory: opsm_ex |
| 68 | + run: mix compile --warnings-as-errors |
| 69 | + |
| 70 | + # ----------------------------------------------------------------------- |
| 71 | + # Start trust pipeline services via selur-compose.yml |
| 72 | + # ----------------------------------------------------------------------- |
| 73 | + |
| 74 | + # GHCR images are public — no registry login required for pulls. |
| 75 | + - name: Pull trust pipeline images |
| 76 | + run: | |
| 77 | + docker pull ghcr.io/hyperpolymath/claim-forge:latest |
| 78 | + docker pull ghcr.io/hyperpolymath/checky-monkey:latest |
| 79 | + docker pull ghcr.io/hyperpolymath/palimpsest-license:latest |
| 80 | + docker pull ghcr.io/hyperpolymath/cicd-hyper-a:latest |
| 81 | + docker pull ghcr.io/hyperpolymath/oikos:latest |
| 82 | +
|
| 83 | + - name: Start trust pipeline (claim-forge, checky-monkey, palimpsest, cicd-hyper-a, oikos) |
| 84 | + run: | |
| 85 | + # Start only the 5 trust-tier services (not the optional container-security profile) |
| 86 | + docker compose -f selur-compose.yml up -d \ |
| 87 | + claim-forge \ |
| 88 | + checky-monkey \ |
| 89 | + palimpsest \ |
| 90 | + cicd-hyper-a \ |
| 91 | + oikos |
| 92 | +
|
| 93 | + - name: Wait for all services to be healthy |
| 94 | + # Polls each /health endpoint; aborts if any service fails to start within 3 minutes |
| 95 | + run: | |
| 96 | + services=( |
| 97 | + "http://localhost:8080/health:claim-forge" |
| 98 | + "http://localhost:8081/health:checky-monkey" |
| 99 | + "http://localhost:8082/health:palimpsest" |
| 100 | + "http://localhost:8083/health:cicd-hyper-a" |
| 101 | + "http://localhost:8084/health:oikos" |
| 102 | + ) |
| 103 | + deadline=$(( $(date +%s) + 180 )) |
| 104 | + for entry in "${services[@]}"; do |
| 105 | + url="${entry%%:*}" |
| 106 | + name="${entry#*:}" |
| 107 | + echo -n "Waiting for $name ($url) " |
| 108 | + until curl -sf "$url" > /dev/null 2>&1; do |
| 109 | + if [ $(date +%s) -ge $deadline ]; then |
| 110 | + echo " TIMEOUT" |
| 111 | + docker compose -f selur-compose.yml logs "$name" || true |
| 112 | + exit 1 |
| 113 | + fi |
| 114 | + echo -n "." |
| 115 | + sleep 3 |
| 116 | + done |
| 117 | + echo " OK" |
| 118 | + done |
| 119 | +
|
| 120 | + # ----------------------------------------------------------------------- |
| 121 | + # Run live-service E2E tests |
| 122 | + # ----------------------------------------------------------------------- |
| 123 | + - name: Run trust pipeline E2E tests |
| 124 | + working-directory: opsm_ex |
| 125 | + env: |
| 126 | + CLAIM_FORGE_URL: "http://localhost:8080" |
| 127 | + CHECKY_MONKEY_URL: "http://localhost:8081" |
| 128 | + PALIMPSEST_URL: "http://localhost:8082" |
| 129 | + CICD_HYPER_A_URL: "http://localhost:8083" |
| 130 | + OIKOS_URL: "http://localhost:8084" |
| 131 | + MIX_ENV: test |
| 132 | + run: | |
| 133 | + mix test test/integration/trust_pipeline_live_e2e_test.exs \ |
| 134 | + --include live_service \ |
| 135 | + --include integration \ |
| 136 | + --trace \ |
| 137 | + --timeout 30000 |
| 138 | +
|
| 139 | + # ----------------------------------------------------------------------- |
| 140 | + # Diagnostics on failure |
| 141 | + # ----------------------------------------------------------------------- |
| 142 | + - name: Dump service logs on failure |
| 143 | + if: failure() |
| 144 | + run: | |
| 145 | + for svc in claim-forge checky-monkey palimpsest cicd-hyper-a oikos; do |
| 146 | + echo "=== $svc logs ===" |
| 147 | + docker compose -f selur-compose.yml logs "$svc" --tail=50 || true |
| 148 | + done |
| 149 | +
|
| 150 | + - name: Stop services |
| 151 | + if: always() |
| 152 | + run: docker compose -f selur-compose.yml down --remove-orphans --volumes |
0 commit comments