-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (96 loc) · 3.13 KB
/
Copy pathci.yml
File metadata and controls
121 lines (96 loc) · 3.13 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
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
release-gate:
name: Release gate
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Forbidden keyword scan
uses: midagedev/review-actions/forbidden-keyword-scan@v1
with:
keywords: ${{ secrets.FORBIDDEN_KEYWORDS }}
fail-on-empty: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
- name: Install frontend dependencies
run: npm ci
- name: Check browser smoke browser
run: google-chrome --version
- name: Go formatting
shell: bash
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "::error::gofmt drift; run 'gofmt -w' on:"
echo "$unformatted"
exit 1
fi
- name: Go tests
run: go test ./...
- name: Compatibility scorecard
run: go run ./cmd/billtap compatibility scorecard --output-dir /tmp/billtap-compatibility
- name: Frontend typecheck
run: npm run typecheck
- name: Frontend build
run: npm run build
- name: Sample app smoke
run: npm run smoke:sample
- name: Stripe SDK smoke
run: npm run smoke:sdk
- name: Web UI smoke
env:
PLAYWRIGHT_CHROMIUM_CHANNEL: chrome
run: npm run smoke:web
- name: Build Billtap binary
run: go build -o /tmp/billtap ./cmd/billtap
- name: Scenario smoke
shell: bash
run: |
set -euo pipefail
PORT=3300 npm --prefix examples/sample-app start > /tmp/billtap-sample-app.log 2>&1 &
sample_pid=$!
cleanup() {
kill "$sample_pid" 2>/dev/null || true
wait "$sample_pid" 2>/dev/null || true
echo "::group::sample app log"
cat /tmp/billtap-sample-app.log || true
echo "::endgroup::"
}
trap cleanup EXIT
for _ in {1..30}; do
if curl -fsS http://127.0.0.1:3300/healthz >/dev/null 2>&1; then
break
fi
if ! kill -0 "$sample_pid" 2>/dev/null; then
echo "sample app exited before becoming ready" >&2
exit 1
fi
sleep 1
done
curl -fsS http://127.0.0.1:3300/healthz >/dev/null
/tmp/billtap scenario run examples/subscription-payment-retry.yml
curl -fsS -X POST http://127.0.0.1:3300/test/reset >/dev/null
/tmp/billtap scenario run examples/saas-adoption-contract.yml
- name: Docker build
run: docker build -t billtap:local .