From 727319d5b280cfacaca4bde1d40a0079e5e2a799 Mon Sep 17 00:00:00 2001 From: Yury Fedorov Date: Fri, 8 Apr 2022 20:00:54 +0300 Subject: [PATCH] Setup postgres service container in CI --- .github/workflows/test.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0947951e..05ca7a1e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -78,6 +78,42 @@ jobs: - name: Test Gnomock connection run: curl localhost:23042/stop -d '{"id":"42"}' + + test-service-containers: + name: "[core] service container" + runs-on: ubuntu-latest + services: + gnomock: + image: orlangure/gnomock:v0.20.0-alpha1 + options: -v /var/run/docker.sock:/var/run/docker.sock + ports: + - 23042:23042 + steps: + - name: Setup postgres + run: | + brew install httpie + http --ignore-stdin -v :23042/start/postgres options[custom_named_ports][default][protocol]=tcp options[custom_named_ports][default][port]:=5432 options[custom_named_ports][default][host_port]:=15432 options[debug]:=true + + - name: Connect + run: | + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + sleep 3 + PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;" || true + test-sdk: name: "[sdk] python" runs-on: ubuntu-latest