Repository navigation
165 lines (160 loc) · 6.31 KB
/
Copy pathci.yml
File metadata and controls
165 lines (160 loc) · 6.31 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
name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
suites:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
- name: Verify public CLI release authority
run: bun run scripts/verify-public-cli-version.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify fresh database migrations
run: |
createdb postil_migrations
bun run release:prepare
# A release retry must repair a missing release ledger and recognize
# every valid concurrent index.
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -c 'DROP TABLE release_steps'
bun run operational:indexes
psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -tAc "SELECT count(*) FROM release_steps WHERE name = 'operational-indexes-v6'" | grep -qx 1
bun run jobs:activate-release --maintenance
env:
PGHOST: localhost
PGUSER: postgres
DATABASE_URL: postgresql://postgres@localhost:5432/postil_migrations
POSTIL_SEALING_KEY: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
- run: bun run test
- name: Verify CLI credentials and inference gateway on fresh Postgres
run: >-
bun test --isolate
tests/cli-device-auth.test.ts
tests/cli-refresh-migration.test.ts
tests/cli-inference-gateway.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
POSTIL_SEALING_KEY: 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
- name: Verify event-driven iLert operator alerts on fresh Postgres
run: bun test --isolate tests/ilert-alert-stream.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
- run: bun test tests/model-override-migration.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
- run: bun test tests/finding-approvals-migration.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
- run: bun test tests/watchdog.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
- name: Verify publication lifecycle locking on fresh Postgres
run: bun test --isolate tests/publication-receipt-migration.test.ts
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
- name: Verify self-service billing on fresh Postgres
run: |
createdb postil_self_service_billing
bun test --isolate tests/self-service-billing.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_self_service_billing
- name: Verify GitHub webhook recovery on fresh Postgres
run: |
createdb postil_webhook_recovery
bun test --isolate tests/github-webhook-redelivery.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_webhook_recovery
- name: Verify private monitoring on fresh Postgres
run: |
createdb postil_private_monitoring
bun test --isolate tests/private-monitoring.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_private_monitoring
- name: Verify GitHub onboarding lifecycle on fresh Postgres
run: |
createdb postil_webhook_lifecycle
bun test --isolate tests/webhook-handlers.test.ts
bun test --isolate tests/github-setup-destination.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_webhook_lifecycle
- name: Verify review dedupe migration with preexisting jobs
run: |
createdb postil_review_dedupe
bun test --isolate tests/review-job-dedupe-migration.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_review_dedupe
- name: Verify queue and notification retirement on fresh Postgres
run: |
createdb postil_queue_retirement
bun test --isolate tests/queue.test.ts
env:
PGHOST: localhost
PGUSER: postgres
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postil_queue_retirement
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run verify:dashboard
env:
POSTIL_TEST_DATABASE_URL: postgresql://postgres@localhost:5432/postgres
POSTIL_DASHBOARD_SERVER: start
test:
runs-on: ubuntu-latest
needs: [suites, build]
if: ${{ always() }}
steps:
- name: Require all CI jobs to succeed
env:
SUITES_RESULT: ${{ needs.suites.result }}
BUILD_RESULT: ${{ needs.build.result }}
run: |
test "$SUITES_RESULT" = success
test "$BUILD_RESULT" = success