-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (141 loc) · 5.95 KB
/
Copy pathci.yml
File metadata and controls
170 lines (141 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: CI (build & test)
# AR-04 — automated quality gates for the .NET backend and the React/Vite frontend.
# The backend job stands up a PostgreSQL service so the WebApplicationFactory integration
# tests (LV-10) actually run instead of skipping, closing the gap that let the LV-04..07
# bug class reach only manual testing.
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: Backend (build + test)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: evolith_tracker
POSTGRES_USER: evolith
POSTGRES_PASSWORD: localdev
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U evolith -d evolith_tracker"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
# Matches the default connection the app + *LiveTests / integration tests expect,
# so the DB-availability probe passes and the integration tests run for real.
EVOLITH_TRACKER_DB: "Host=localhost;Port=5432;Database=evolith_tracker;Username=evolith;Password=localdev"
ConnectionStrings__DefaultConnection: "Host=localhost;Port=5432;Database=evolith_tracker;Username=evolith;Password=localdev"
# TenantProjectionDbContext (DS-07) reads MasterDataDb; unset it defaults to
# localhost/user "postgres" and auth fails. Share the CI Postgres like local.
ConnectionStrings__MasterDataDb: "Host=localhost;Port=5432;Database=evolith_tracker;Username=evolith;Password=localdev"
DOTNET_NOLOGO: "true"
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
defaults:
run:
working-directory: src/apps/tracker-api
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Restore
run: dotnet restore Tracker.sln
- name: Build (0 warnings enforced)
run: dotnet build Tracker.sln --no-restore -c Release -warnaserror
- name: Apply EF Core migrations
run: |
dotnet tool install --global dotnet-ef
export PATH="$PATH:$HOME/.dotnet/tools"
# Two DbContexts exist (DS-07 added TenantProjectionDbContext for the
# MasterData tenant-projection schema). `database update` is ambiguous
# without --context. Pass --connection explicitly so both apply against
# the CI Postgres regardless of design-time config resolution (the
# TenantProjection context otherwise falls back to localhost/postgres).
CI_CONN="Host=localhost;Port=5432;Database=evolith_tracker;Username=evolith;Password=localdev"
for ctx in TrackerDbContext TenantProjectionDbContext; do
dotnet ef database update \
--context "$ctx" \
--connection "$CI_CONN" \
--project Tracker.Infrastructure \
--startup-project Tracker.Presentation \
--configuration Release
done
- name: Test
run: dotnet test Tracker.sln --no-build -c Release --logger "trx;LogFileName=test-results.trx"
- name: Smoke — la aplicacion arranca LIMPIA contra Postgres
# Anadido tras la regresion del 2026-07-19: el filtro global por tenant de CD-27
# rompio el despachador del outbox de intake y estuvo horas en `main` sin que nada lo
# viera. CI aplicaba migraciones pero NUNCA ARRANCABA LA APLICACION, y el SQL crudo
# no se interpreta hasta que hay un motor real detras.
#
# El script no se conforma con que responda: durante todo aquel fallo `/health` daba
# 200 mientras el despachador reventaba en cada ciclo. Observa el LOG, y observa el
# tiempo suficiente para que los procesos de fondo completen varias vueltas.
working-directory: .
env:
SMOKE_CONFIG: Release
SMOKE_OBSERVE_SECONDS: "25"
run: bash .harness/scripts/smoke-app.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: backend-test-results
path: src/apps/tracker-api/**/TestResults/*.trx
if-no-files-found: ignore
frontend:
name: Frontend (lint + typecheck + build)
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: src/package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npx nx lint tracker-web
- name: Typecheck
run: npx nx typecheck tracker-web
- name: Build
run: npx nx build tracker-web
gap-registry:
name: Gap registry coherence
runs-on: ubuntu-latest
# Deliberadamente SIN filtro `paths`: corre en todo PR. El desorden que vigila no lo
# introduce quien edita los ficheros del registro, sino quien CIERRA un item y actualiza
# la fila del board olvidando la ficha — un cambio que casi siempre viene acompanado de
# codigo. Filtrar por rutas dejaria fuera justo el caso que motivo este guardian.
#
# Falla el build a proposito. Un registro de gobernanza que miente sobre que esta hecho
# dirige mal las decisiones de la semana siguiente, y un guardian que solo avisa se
# ignora. El job tarda segundos y no necesita ni base de datos ni SDK.
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Board y catalogo deben contar lo mismo
run: python3 .harness/scripts/check-gap-registry.py