-
Notifications
You must be signed in to change notification settings - Fork 85
182 lines (176 loc) · 6.49 KB
/
Copy pathtest.yml
File metadata and controls
182 lines (176 loc) · 6.49 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: test
on:
push:
tags:
- v*
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
# v3.0.1 with Go 1.25.0
- surrealdb-version: 'v3.0.1'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
- surrealdb-version: 'v3.0.1'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
# v2.6.0 with Go 1.25.0, http
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
# v2.6.0 with Go 1.25.0, http, fxamackercbor (legacy)
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
surrealdb-cbor-impl: 'fxamackercbor'
# v2.6.0 with Go 1.25.0, gorilla/websocket
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
# v2.6.0 with Go 1.25.0, gorilla/websocket, fxamackercbor (legacy)
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-cbor-impl: 'fxamackercbor'
# v2.6.0 with Go 1.25.0, gorilla/websocket, reconnection
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-reconnection-check-interval: '1s'
# v2.6.0 with Go 1.25.0, gws
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-connection-impl: 'gws'
# v2.6.0 with Go 1.25.0, gws, reconnection
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-connection-impl: 'gws'
surrealdb-reconnection-check-interval: '1s'
# v2.6.0 with Go 1.25.0, explicit surrealcbor
- surrealdb-version: 'v2.6.0'
go-version: '1.25.0'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
surrealdb-cbor-impl: 'surrealcbor'
# v2.6.0 with Go 1.24.6
- surrealdb-version: 'v2.6.0'
go-version: '1.24.6'
connection-type: 'ws'
surrealdb-url: 'ws://localhost:8000/rpc'
- surrealdb-version: 'v2.6.0'
go-version: '1.24.6'
connection-type: 'http'
surrealdb-url: 'http://localhost:8000'
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: go.sum
- name: Start SurrealDB
run: |
docker run -d --name surrealdb -p 8000:8000 surrealdb/surrealdb:${{ matrix.surrealdb-version }} start --user root --pass root
# Wait for SurrealDB to be ready
for i in {1..30}; do
if curl -f http://localhost:8000/health 2>/dev/null; then
echo "SurrealDB is ready"
break
fi
echo "Waiting for SurrealDB to start... ($i/30)"
sleep 2
done
- name: Test ${{ matrix.connection-type }} connection
run: go test -v -cover -race ./...
env:
SURREALDB_URL: ${{ matrix.surrealdb-url }}
SURREALDB_CONNECTION_IMPL: ${{ matrix.surrealdb-connection-impl }}
SURREALDB_CBOR_IMPL: ${{ matrix.surrealdb-cbor-impl }}
SURREALDB_RECONNECTION_CHECK_INTERVAL: ${{ matrix.surrealdb-reconnection-check-interval }}
surrealnote-e2e:
name: SurrealNote E2E Tests
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: contrib/surrealnote/go.sum
# Start SurrealDB
- name: Start SurrealDB
run: |
docker run -d --name surrealdb -p 8000:8000 surrealdb/surrealdb:v2.6.0 start --user root --pass root
# Wait for SurrealDB to be ready
for i in {1..30}; do
if curl -f http://localhost:8000/health 2>/dev/null; then
echo "SurrealDB is ready"
break
fi
echo "Waiting for SurrealDB to start... ($i/30)"
sleep 2
done
# Run E2E migration test using Makefile
- name: Run SurrealNote E2E Migration Test
run: |
cd contrib/surrealnote
# The Makefile will handle PostgreSQL start/stop automatically
go test -v -race -timeout 10m -run TestE2E_migrationFlow ./...
env:
SURREALDB_URL: ws://localhost:8000/rpc
# Clean up containers
- name: Clean up containers
if: always()
run: |
cd contrib/surrealnote
make postgres-remove || true
docker stop surrealdb || true
docker rm surrealdb || true
surrealcbor-timezone:
name: surrealcbor timezone tests (TZ=${{ matrix.timezone }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
timezone: [UTC, Asia/Jerusalem]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: go.sum
- name: Run datetime decode tests
run: |
go test -v -race ./surrealcbor/... \
-run 'TestDecode_(array|map)_withAllSupportedTypes|TestDecode_map_structwithAllSupportedTypes'
env:
TZ: ${{ matrix.timezone }}