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

ci.yml

168 lines8.0 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 Realtime and Object Storage integration
53 run: pnpm test:neon --reporter=default --reporter=json --outputFile=neon-results.json
54 - name: Preserve packed mixed-version Function evidence
55 if: ${{ always() && hashFiles('qualification-results/rolling-upgrade.json') != '' }}
56 uses: actions/upload-artifact@v4
57 with:
58 name: rolling-upgrade-${{ github.run_id }}-${{ github.run_attempt }}
59 path: qualification-results/rolling-upgrade.json
60 - name: Summarize real-service test results immediately
61 if: ${{ always() && hashFiles('neon-results.json') != '' }}
62 run: node scripts/summarize-test-results.mjs neon-results.json neon-test-summary.json
63 - uses: actions/upload-artifact@v4
64 if: ${{ always() && hashFiles('neon-test-summary.json') != '' }}
65 with:
66 name: neon-tests-${{ github.run_id }}-${{ github.run_attempt }}
67 path: neon-test-summary.json
68 - name: Postgres integration and process-loss tests on Neon
69 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
70 run: pnpm test:integration --reporter=default --reporter=json --outputFile=integration-results.json
71 - name: Summarize transaction test results immediately
72 if: ${{ always() && hashFiles('integration-results.json') != '' }}
73 run: node scripts/summarize-test-results.mjs integration-results.json integration-test-summary.json
74 - uses: actions/upload-artifact@v4
75 if: ${{ always() && hashFiles('integration-test-summary.json') != '' }}
76 with:
77 name: transaction-tests-${{ github.run_id }}-${{ github.run_attempt }}
78 path: integration-test-summary.json
79 - name: Point-in-time branch adoption and stopped-Function in-place restore
80 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
81 run: pnpm test:recovery --reporter=default --reporter=json --outputFile=recovery-results.json
82 - name: Summarize recovery failures immediately
83 if: ${{ always() && hashFiles('recovery-results.json') != '' }}
84 run: node scripts/summarize-test-results.mjs recovery-results.json recovery-test-summary.json
85 - uses: actions/upload-artifact@v4
86 if: ${{ always() && hashFiles('recovery-test-summary.json') != '' }}
87 with:
88 name: recovery-tests-${{ github.run_id }}-${{ github.run_attempt }}
89 path: recovery-test-summary.json
90 - name: Preserve in-place restore evidence
91 if: ${{ always() && hashFiles('qualification-results/inplace-restore.json') != '' }}
92 uses: actions/upload-artifact@v4
93 with:
94 name: inplace-restore-${{ github.run_id }}-${{ github.run_attempt }}
95 path: qualification-results/inplace-restore.json
96 - name: Preserve Function rollout readiness probes
97 if: ${{ always() && hashFiles('qualification-results/function-readiness-*.json') != '' }}
98 uses: actions/upload-artifact@v4
99 with:
100 name: runtime-readiness-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
101 path: qualification-results/function-readiness-*.json
102 - name: Full upstream conformance colocated on Neon (subscriptions enabled)
103 if: ${{ !cancelled() && env.NEON_TEST_BRANCH_ID != '' }}
104 run: pnpm test:conformance:neon
105 - name: Preserve colocated suite provenance and runtime
106 if: ${{ always() && hashFiles('qualification-results/colocated-conformance.json') != '' }}
107 uses: actions/upload-artifact@v4
108 with:
109 name: conformance-runtime-${{ github.run_id }}-${{ github.run_attempt }}
110 path: qualification-results/colocated-conformance.json
111 - name: Preserve complete conformance results
112 if: ${{ always() && hashFiles('conformance-results.json') != '' }}
113 uses: actions/upload-artifact@v4
114 with:
115 name: full-conformance-${{ github.run_id }}-${{ github.run_attempt }}
116 path: conformance-results.json
117 - name: Delete any interrupted recovery drill branch
118 if: ${{ always() && hashFiles('.neon-test-state-recovery.json') != '' }}
119 env:
120 NEON_TEST_STATE_FILE: .neon-test-state-recovery.json
121 run: pnpm neon:test:delete
122 - name: Delete interrupted in-place restore branches
123 if: ${{ always() && hashFiles('.neon-test-state-inplace.json') != '' }}
124 run: node scripts/neon-test-inplace-cleanup.mjs
125 - name: Delete interrupted rolling Functions and installed consumers
126 if: ${{ always() && (hashFiles('.neon-test-state-rolling.json') != '' || hashFiles('.neon-test-state-rolling-artifacts.json') != '') }}
127 run: node scripts/neon-test-rolling-cleanup.mjs
128 - name: Delete this run's Neon branch
129 if: ${{ always() && hashFiles('.neon-test-state.json') != '' }}
130 run: pnpm neon:test:delete
131​
132 hints:
133 name: Neon append-hint delivery
134 runs-on: ubuntu-latest
135 timeout-minutes: 15
136 env:
137 NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
138 NEON_PROJECT_ID: ${{ vars.NEON_PROJECT_ID }}
139 NEON_PARENT_BRANCH_ID: ${{ vars.NEON_PARENT_BRANCH_ID }}
140 NEON_TEST_BRANCH_LABEL: hints
141 NEON_TEST_MAINTENANCE_HINTS: 'on'
142 NEON_TEST_NO_CRON: '1'
143 steps:
144 - uses: actions/checkout@v4
145 - name: Require real Neon credentials
146 run: test -n "$NEON_API_KEY" && test -n "$NEON_PROJECT_ID" && test -n "$NEON_PARENT_BRANCH_ID"
147 - uses: pnpm/action-setup@v4
148 - uses: actions/setup-node@v4
149 with:
150 node-version-file: .node-version
151 cache: pnpm
152 - run: pnpm install --frozen-lockfile
153 - run: pnpm build
154 - name: Provision a separate isolated Neon branch
155 run: pnpm neon:test:create
156 - name: Deploy with append hints and no scheduled worker
157 run: pnpm neon:test:deploy
158 - name: Prove hinted Realtime wakes and full-chunk sealing
159 run: pnpm test:hints
160 - name: Preserve Function rollout readiness probes
161 if: ${{ always() && hashFiles('qualification-results/function-readiness-*.json') != '' }}
162 uses: actions/upload-artifact@v4
163 with:
164 name: runtime-readiness-${{ github.job }}-${{ github.run_id }}-${{ github.run_attempt }}
165 path: qualification-results/function-readiness-*.json
166 - name: Delete the hint test branch
167 if: ${{ always() && hashFiles('.neon-test-state.json') != '' }}
168 run: pnpm neon:test:delete