Repository navigation
106 lines (91 loc) · 3.4 KB
/
Copy pathci.yml
File metadata and controls
106 lines (91 loc) · 3.4 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
name: CI
on:
push:
branches: [main, develop]
pull_request:
workflow_call:
jobs:
backend:
name: Contracts sync, migrate, build, test
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_USER: oracledesk
POSTGRES_PASSWORD: oracledesk
POSTGRES_DB: oracledesk
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U oracledesk"
--health-interval 5s --health-timeout 5s --health-retries 10
redis:
image: redis:7-alpine
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s --health-timeout 5s --health-retries 10
env:
# Throwaway CI service credentials, not secrets.
DATABASE_URL: postgresql://oracledesk:oracledesk@localhost:5432/oracledesk
REDIS_URL: redis://localhost:6379
NODE_ENV: test
CHAIN_EXECUTION_MODE: dry-run
INDEXER_ENABLED: "false"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Generated contract code matches the submodule
run: npm run check:contracts
- run: npx prisma generate
- run: npx prisma migrate deploy
- name: Verify schema datamodel matches migrations
run: npx prisma migrate diff --from-migrations prisma/migrations --to-schema-datamodel prisma/schema.prisma --exit-code
- name: Audit database constraints
run: npx tsx scripts/audit-constraints.ts --json audit.json
- run: npm run build
# #64: the contracts repo's x402 service runs against backend-produced
# traces. Its dependencies are installed from the submodule's lockfile.
- name: Cache x402 dependencies
uses: actions/cache@v4
with:
path: contracts/oracledesk-stellar/x402/node_modules
key: x402-node-modules-${{ runner.os }}-${{ hashFiles('contracts/oracledesk-stellar/x402/package-lock.json') }}
- name: Install x402 test dependencies
run: npm run test:x402:prepare
- run: npm test
# #67: deterministic replay of recorded model outputs; needs no provider
# keys. --live is manual only and never runs in CI.
- name: Evaluate market generation (replay)
run: npm run eval:markets -- --replay
# #69: harness check for the dedup threshold sweep on the committed pair set.
- name: Calibrate dedup (fake provider)
run: npm run calibrate:dedup -- --provider fake
- name: End-to-end x402 test
run: npm run test:e2e:x402
# Integration tier (#135): real Postgres 16 + Redis 7 from the service
# containers above. TEST_DATABASE_URL is the admin DB, used to clone a
# migrated template database per test file.
- name: Integration tests
run: npm run test:integration
env:
TEST_DATABASE_URL: postgresql://oracledesk:oracledesk@localhost:5432/postgres
TEST_REDIS_URL: redis://localhost:6379
migrations:
name: Migration lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Lint new migrations
run: npm run lint:migrations