-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (141 loc) · 5.5 KB
/
Copy pathintegration-tests.yml
File metadata and controls
153 lines (141 loc) · 5.5 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
name: integration-tests
# Enforces the persistence + api-contract conformance corpora — the Docker /
# Testcontainers suites that are NOT in the default `mvn test` / `dotnet test` /
# `bun test` path — against a real Postgres for all five ports. Per-language jobs
# run in parallel; any port red blocks the gate.
#
# COST: this 5-port Testcontainers matrix is EXPENSIVE, so it does NOT run on every
# push/PR. Triggers:
# - tag push matching v* (the release gate, per docs/RELEASING.md).
# - manual dispatch (workflow_dispatch).
# Day-to-day, run these corpora LOCALLY before opening/merging a PR:
# scripts/ci-local.sh # full local CI (this suite + conformance + drift)
# scripts/integration-test.sh <port>
# The cheap public-repo SECURITY gate (hygiene / leak-scan) still runs on every PR.
# Push-to-main coverage now comes from local-ci.yml on the self-hosted runner.
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release-gate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
port: [ts, csharp, java, kotlin, python]
# A single job-level Postgres sidecar shared by every port, instead of each
# port booting (and pulling) its own container per scenario. Mirrors the
# migrate-ts-pg job below. Each port's PG helper, when it sees
# METAOBJECTS_TEST_PG_URL, connects to this sidecar and CREATEs a
# uniquely-named database per scenario (dropping it on stop) — preserving the
# "fresh empty DB per scenario" isolation the per-port containers gave, with
# no image pull / container boot on the hot path. Local dev (no env var) still
# boots per-port containers exactly as before.
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: metaobjects
POSTGRES_PASSWORD: metaobjects
POSTGRES_DB: metaobjects_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U metaobjects"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Bun (TS port)
if: matrix.port == 'ts'
uses: oven-sh/setup-bun@v2
with:
# Pin a known-good Bun (1.3.8 segfaults on exit; see the flake that cost a
# full re-run). setup-bun caches the Bun binary but NOT `bun install`
# output — the actions/cache step below does that.
bun-version: '1.3.14'
- name: Cache Bun install cache (TS port)
if: matrix.port == 'ts'
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Set up .NET (C# port)
if: matrix.port == 'csharp'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache NuGet packages (C# port)
if: matrix.port == 'csharp'
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('server/csharp/**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Set up JDK (Java and Kotlin ports)
if: matrix.port == 'java' || matrix.port == 'kotlin'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: maven
- name: Set up uv (Python port)
if: matrix.port == 'python'
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install workspace deps
if: matrix.port == 'ts'
run: bun install
- name: Run integration tests
env:
# The shared sidecar's admin URL. Each port's PG helper sees this and
# creates/drops a uniquely-named database per scenario off it, rather
# than booting its own container. Unset locally → per-port container
# fallback.
METAOBJECTS_TEST_PG_URL: postgres://metaobjects:metaobjects@localhost:5432/metaobjects_test
run: ./scripts/integration-test.sh ${{ matrix.port }}
# migrate-ts PG integration tests — the apply / lifecycle / rollback +
# introspection suites that exercise REAL Postgres behavior (advisory locks,
# multi-tenant ledger, down-migrations) that pg-mem cannot fake. They
# `describe.skip` unless MIGRATE_TS_PG_URL is set, so no workflow ran them
# until now. A `services: postgres` container supplies the URL.
migrate-ts-pg:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: migrate
POSTGRES_PASSWORD: migrate
POSTGRES_DB: migrate_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U migrate"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Cache Bun install cache
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- run: bun install
- name: Run migrate-ts suite against real Postgres
env:
MIGRATE_TS_PG_URL: postgres://migrate:migrate@localhost:5432/migrate_test
run: cd server/typescript/packages/migrate-ts && bun test