Skip to content

Commit 35d1b12

Browse files
committed
WIP: Use embedded Postgres instead of Docker container.
Right now, this uses my fork of embeddedpostgres with a patch allowing the use of UNIX sockets for the database, so not to have to worry about the availability of ports.
1 parent 9a2b773 commit 35d1b12

File tree

4 files changed

+44
-144
lines changed

4 files changed

+44
-144
lines changed

.github/workflows/backend_test_workflow.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,13 @@ jobs:
2323
- name: Build
2424
run: go build -v ./...
2525

26+
- name: Cache embedded postgres
27+
uses: actions/cache@v4
28+
env:
29+
cache-name: cache-embedded-postgres
30+
with:
31+
key: pg
32+
path: ~/.embedded-postgres-go
33+
2634
- name: Test
2735
run: go test -v ./...

go.mod

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/biter777/countries v1.7.5
1414
github.com/cockroachdb/errors v1.11.3
1515
github.com/exaring/otelpgx v0.6.1
16+
github.com/fergusstrange/embedded-postgres v1.30.0
1617
github.com/gavv/httpexpect/v2 v2.16.0
1718
github.com/getsentry/sentry-go v0.28.1
1819
github.com/gin-contrib/cors v1.7.2
@@ -27,18 +28,18 @@ require (
2728
github.com/hashicorp/golang-lru/v2 v2.0.7
2829
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
2930
github.com/jackc/pgx/v5 v5.7.1
31+
github.com/mitchellh/copystructure v1.2.0
3032
github.com/mitchellh/hashstructure/v2 v2.0.2
3133
github.com/oapi-codegen/oapi-codegen/v2 v2.3.0
3234
github.com/oapi-codegen/runtime v1.1.1
33-
github.com/ory/dockertest/v3 v3.10.0
3435
github.com/pashagolub/pgxmock/v4 v4.4.0
3536
github.com/pkg/errors v0.9.1
3637
github.com/pressly/goose/v3 v3.20.0
3738
github.com/riverqueue/river v0.14.0
3839
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.14.0
3940
github.com/riverqueue/river/rivertype v0.14.0
4041
github.com/segmentio/analytics-go/v3 v3.3.0
41-
github.com/stretchr/testify v1.9.0
42+
github.com/stretchr/testify v1.10.0
4243
github.com/tidwall/gjson v1.18.0
4344
github.com/vearne/gin-timeout v0.2.0
4445
go.opentelemetry.io/contrib/detectors/gcp v1.27.0
@@ -65,20 +66,16 @@ require (
6566
cloud.google.com/go/longrunning v0.5.12 // indirect
6667
cloud.google.com/go/storage v1.43.0 // indirect
6768
cloud.google.com/go/trace v1.10.12 // indirect
68-
dario.cat/mergo v1.0.0 // indirect
6969
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect
7070
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
7171
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
7272
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.2 // indirect
73-
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
7473
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
7574
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
7675
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
7776
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.0 // indirect
7877
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.0 // indirect
7978
github.com/MicahParks/keyfunc v1.9.0 // indirect
80-
github.com/Microsoft/go-winio v0.6.1 // indirect
81-
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
8279
github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 // indirect
8380
github.com/ajg/form v1.5.1 // indirect
8481
github.com/andybalholm/brotli v1.1.0 // indirect
@@ -105,17 +102,11 @@ require (
105102
github.com/aws/smithy-go v1.20.3 // indirect
106103
github.com/bytedance/sonic v1.11.8 // indirect
107104
github.com/bytedance/sonic/loader v0.1.1 // indirect
108-
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
109105
github.com/cloudwego/base64x v0.1.4 // indirect
110106
github.com/cloudwego/iasm v0.2.0 // indirect
111107
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
112108
github.com/cockroachdb/redact v1.1.5 // indirect
113-
github.com/containerd/continuity v0.4.1 // indirect
114109
github.com/davecgh/go-spew v1.1.1 // indirect
115-
github.com/docker/cli v26.1.4+incompatible // indirect
116-
github.com/docker/docker v26.1.5+incompatible // indirect
117-
github.com/docker/go-connections v0.5.0 // indirect
118-
github.com/docker/go-units v0.5.0 // indirect
119110
github.com/fatih/color v1.15.0 // indirect
120111
github.com/fatih/structs v1.1.0 // indirect
121112
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -137,7 +128,6 @@ require (
137128
github.com/golang/protobuf v1.5.4 // indirect
138129
github.com/google/go-querystring v1.1.0 // indirect
139130
github.com/google/s2a-go v0.1.8 // indirect
140-
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
141131
github.com/google/wire v0.6.0 // indirect
142132
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
143133
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
@@ -160,22 +150,16 @@ require (
160150
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
161151
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
162152
github.com/leodido/go-urn v1.4.0 // indirect
153+
github.com/lib/pq v1.10.9 // indirect
163154
github.com/mailru/easyjson v0.7.7 // indirect
164155
github.com/mattn/go-colorable v0.1.13 // indirect
165156
github.com/mattn/go-isatty v0.0.20 // indirect
166157
github.com/mfridman/interpolate v0.0.2 // indirect
167-
github.com/mitchellh/copystructure v1.2.0 // indirect
168158
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
169-
github.com/mitchellh/mapstructure v1.5.0 // indirect
170159
github.com/mitchellh/reflectwalk v1.0.2 // indirect
171-
github.com/moby/docker-image-spec v1.3.1 // indirect
172-
github.com/moby/term v0.5.0 // indirect
173160
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
174161
github.com/modern-go/reflect2 v1.0.2 // indirect
175162
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
176-
github.com/opencontainers/go-digest v1.0.0 // indirect
177-
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
178-
github.com/opencontainers/runc v1.1.14 // indirect
179163
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
180164
github.com/perimeterx/marshmallow v1.1.5 // indirect
181165
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
@@ -187,7 +171,6 @@ require (
187171
github.com/segmentio/backo-go v1.1.0 // indirect
188172
github.com/sergi/go-diff v1.0.0 // indirect
189173
github.com/sethvargo/go-retry v0.2.4 // indirect
190-
github.com/sirupsen/logrus v1.9.3 // indirect
191174
github.com/stretchr/objx v0.5.2 // indirect
192175
github.com/tidwall/match v1.1.1 // indirect
193176
github.com/tidwall/pretty v1.2.1 // indirect
@@ -199,6 +182,7 @@ require (
199182
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
200183
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
201184
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
185+
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
202186
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
203187
github.com/yudai/gojsondiff v1.0.0 // indirect
204188
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
@@ -226,3 +210,5 @@ require (
226210
gopkg.in/yaml.v3 v3.0.1 // indirect
227211
moul.io/http2curl/v2 v2.3.0 // indirect
228212
)
213+
214+
replace github.com/fergusstrange/embedded-postgres v1.30.0 => github.com/apognu/embedded-postgres v0.0.0-20250303073547-f2de69a64383

0 commit comments

Comments
 (0)