File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -226,10 +226,40 @@ jobs:
226226 path : dist/${{ matrix.name == 'apple-xcframework' && 'CloudSync.*' || 'cloudsync.*'}}
227227 if-no-files-found : error
228228
229+ postgres-test :
230+ runs-on : ubuntu-22.04
231+ name : postgresql build + test
232+ timeout-minutes : 10
233+
234+ steps :
235+
236+ - uses : actions/checkout@v4.2.2
237+
238+ - name : build and start postgresql container
239+ run : make postgres-docker-rebuild
240+
241+ - name : wait for postgresql to be ready
242+ run : |
243+ for i in $(seq 1 30); do
244+ if docker exec cloudsync-postgres pg_isready -U postgres > /dev/null 2>&1; then
245+ echo "PostgreSQL is ready"
246+ exit 0
247+ fi
248+ sleep 2
249+ done
250+ echo "PostgreSQL failed to start within 60s"
251+ docker logs cloudsync-postgres
252+ exit 1
253+
254+ - name : run postgresql tests
255+ run : |
256+ docker cp test/postgresql cloudsync-postgres:/tmp/cloudsync/test/postgresql
257+ docker exec cloudsync-postgres psql -U postgres -d postgres -f /tmp/cloudsync/test/postgresql/full_test.sql
258+
229259 release :
230260 runs-on : ubuntu-22.04
231261 name : release
232- needs : build
262+ needs : [ build, postgres-test]
233263 if : github.ref == 'refs/heads/main'
234264
235265 env :
You can’t perform that action at this time.
0 commit comments