Skip to content
Source
Sign inSign up
samwillis/neon-durable-streams
Open History to see the last commit

ci.yml

180 lines8.7 KB

1name: Library checks
2on: [push, pull_request, workflow_dispatch]
3concurrency:
4 group: library-checks-${{ github.ref }}
5 cancel-in-progress: false
6permissions:
7 contents: read
8jobs:
9 check:
10 name: Build and unit tests
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v4
14 - uses: pnpm/action-setup@v4
15 - uses: actions/setup-node@v4
16 with:
17 node-version-file: .node-version
18 cache: pnpm
19 - run: pnpm install --frozen-lockfile
20 - run: pnpm check
21 - run: pnpm test:package
22​
23 neon:
24 name: Neon qualification
25 runs-on: ubuntu-latest
26 timeout-minutes: 90
27 env:
28 NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
29 NEON_PROJECT_ID: ${{ vars.NEON_PROJECT_ID }}
30 NEON_PARENT_BRANCH_ID: ${{ vars.NEON_PARENT_BRANCH_ID }}
31 steps:
32 - uses: actions/checkout@v4
33 - name: Require real Neon credentials
34 run: |
35 test -n "$NEON_API_KEY" && test -n "$NEON_PROJECT_ID" && test -n "$NEON_PARENT_BRANCH_ID" || {
36 echo 'Neon qualification requires project-scoped credentials. Fork PRs must be reviewed and tested on a trusted maintainer branch.'
37 exit 1
38 }
39 - uses: pnpm/action-setup@v4
40 - uses: actions/setup-node@v4
41 with:
42 node-version-file: .node-version
43 cache: pnpm
44 - run: pnpm install --frozen-lockfile
45 - name: Provision isolated Neon Postgres, Realtime, and Object Storage
46 run: pnpm neon:test:create
47 - run: pnpm build
48 - name: Deploy the consumer Function and its recovery trigger on this branch
49 run: pnpm neon:test:deploy
50 - name: Actual Function ingress, HTTPS webhooks, SSE, sealed replay, and cron recovery
51 run: pnpm test:function
52 - name: Real Neon data regressions colocated with Postgres, Realtime, and Object Storage
53 env:
54 NEON_QUALIFICATION_PROFILE: neon
55 run: node scripts/neon-test-conformance.mjs
56 - name: Independently packed multi-instance consumers and recovery fencing
57 run: pnpm exec vitest run --project neon test/neon/rolling.test.ts
58 - name: Preserve packed multi-instance Function evidence
59 if: ${{ always() && hashFiles('qualification-results/rolling-upgrade.json') != '' }}
60 uses: actions/upload-artifact@v4
61 with:
62 name: rolling-upgrade-${{ github.run_id }}-${{ github.run_attempt }}
63 path: qualification-results/rolling-upgrade.json
64 - name: Summarize real-service test results immediately
65 if: ${{ always() && hashFiles('qualification-results/colocated-neon-results.json') != '' }}
66 run: node scripts/summarize-test-results.mjs qualification-results/colocated-neon-results.json neon-test-summary.json
67 - uses: actions/upload-artifact@v4
68 if: ${{ always() && hashFiles('neon-test-summary.json') != '' }}
69 with:
70 name: neon-tests-${{ github.run_id }}-${{ github.run_attempt }}
71 path: neon-test-summary.json
72 - name: Postgres integration and process-loss tests on Neon
73 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
74 env:
75 NEON_QUALIFICATION_PROFILE: integration
76 run: node scripts/neon-test-conformance.mjs
77 - name: Summarize transaction test results immediately
78 if: ${{ always() && hashFiles('qualification-results/colocated-integration-results.json') != '' }}
79 run: node scripts/summarize-test-results.mjs qualification-results/colocated-integration-results.json integration-test-summary.json
80 - uses: actions/upload-artifact@v4
81 if: ${{ always() && hashFiles('integration-test-summary.json') != '' }}
82 with:
83 name: transaction-tests-${{ github.run_id }}-${{ github.run_attempt }}
84 path: integration-test-summary.json
85 - name: Point-in-time branch adoption and stopped-Function in-place restore
86 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
87 run: pnpm test:recovery --reporter=default --reporter=json --outputFile=recovery-results.json
88 - name: Summarize recovery failures immediately
89 if: ${{ always() && hashFiles('recovery-results.json') != '' }}
90 run: node scripts/summarize-test-results.mjs recovery-results.json recovery-test-summary.json
91 - uses: actions/upload-artifact@v4
92 if: ${{ always() && hashFiles('recovery-test-summary.json') != '' }}
93 with:
94 name: recovery-tests-${{ github.run_id }}-${{ github.run_attempt }}
95 path: recovery-test-summary.json
96 - name: Preserve in-place restore evidence
97 if: ${{ always() && hashFiles('qualification-results/inplace-restore.json') != '' }}
98 uses: actions/upload-artifact@v4
99 with:
100 name: inplace-restore-${{ github.run_id }}-${{ github.run_attempt }}
101 path: qualification-results/inplace-restore.json
102 - name: Preserve Function rollout readiness probes
103 if: ${{ always() && hashFiles('qualification-results/function-readiness-*.json') != '' }}
104 uses: actions/upload-artifact@v4
105 with:
106 name: runtime-readiness-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
107 path: qualification-results/function-readiness-*.json
108 - name: Full upstream conformance colocated on Neon (subscriptions enabled)
109 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
110 run: pnpm test:conformance:neon
111 - name: Preserve colocated suite provenance and runtime
112 if: ${{ always() && hashFiles('qualification-results/colocated-conformance.json') != '' }}
113 uses: actions/upload-artifact@v4
114 with:
115 name: conformance-runtime-${{ github.run_id }}-${{ github.run_attempt }}
116 path: qualification-results/colocated-conformance.json
117 - name: Preserve complete conformance results
118 if: ${{ always() && hashFiles('conformance-results.json') != '' }}
119 uses: actions/upload-artifact@v4
120 with:
121 name: full-conformance-${{ github.run_id }}-${{ github.run_attempt }}
122 path: conformance-results.json
123 - name: Preserve colocated regression and transaction provenance
124 if: ${{ always() && hashFiles('qualification-results/colocated-*.json') != '' }}
125 uses: actions/upload-artifact@v4
126 with:
127 name: colocated-data-${{ github.run_id }}-${{ github.run_attempt }}
128 path: qualification-results/colocated-*.json
129 - name: Delete any interrupted recovery drill branch
130 if: ${{ always() && hashFiles('.neon-test-state-recovery.json') != '' }}
131 env:
132 NEON_TEST_STATE_FILE: .neon-test-state-recovery.json
133 run: pnpm neon:test:delete
134 - name: Delete interrupted in-place restore branches
135 if: ${{ always() && hashFiles('.neon-test-state-inplace.json') != '' }}
136 run: node scripts/neon-test-inplace-cleanup.mjs
137 - name: Delete interrupted rolling Functions and installed consumers
138 if: ${{ always() && (hashFiles('.neon-test-state-rolling.json') != '' || hashFiles('.neon-test-state-rolling-artifacts.json') != '') }}
139 run: node scripts/neon-test-rolling-cleanup.mjs
140 - name: Delete this run's Neon branch
141 if: ${{ always() && hashFiles('.neon-test-state.json') != '' }}
142 run: pnpm neon:test:delete
143​
144 hints:
145 name: Neon append-hint delivery
146 runs-on: ubuntu-latest
147 timeout-minutes: 15
148 env:
149 NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
150 NEON_PROJECT_ID: ${{ vars.NEON_PROJECT_ID }}
151 NEON_PARENT_BRANCH_ID: ${{ vars.NEON_PARENT_BRANCH_ID }}
152 NEON_TEST_BRANCH_LABEL: hints
153 NEON_TEST_MAINTENANCE_HINTS: 'on'
154 NEON_TEST_NO_CRON: '1'
155 steps:
156 - uses: actions/checkout@v4
157 - name: Require real Neon credentials
158 run: test -n "$NEON_API_KEY" && test -n "$NEON_PROJECT_ID" && test -n "$NEON_PARENT_BRANCH_ID"
159 - uses: pnpm/action-setup@v4
160 - uses: actions/setup-node@v4
161 with:
162 node-version-file: .node-version
163 cache: pnpm
164 - run: pnpm install --frozen-lockfile
165 - run: pnpm build
166 - name: Provision a separate isolated Neon branch
167 run: pnpm neon:test:create
168 - name: Deploy with append hints and no scheduled worker
169 run: pnpm neon:test:deploy
170 - name: Prove hinted Realtime wakes and full-chunk sealing
171 run: pnpm test:hints
172 - name: Preserve Function rollout readiness probes
173 if: ${{ always() && hashFiles('qualification-results/function-readiness-*.json') != '' }}
174 uses: actions/upload-artifact@v4
175 with:
176 name: runtime-readiness-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
177 path: qualification-results/function-readiness-*.json
178 - name: Delete the hint test branch
179 if: ${{ always() && hashFiles('.neon-test-state.json') != '' }}
180 run: pnpm neon:test:delete