Skip to content

Commit 5742636

Browse files
committed
Attempt to make postgres in actions
1 parent 632285c commit 5742636

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ jobs:
2929
- 3306:3306
3030
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
3131

32+
postgres:
33+
image: postgres:latest
34+
env:
35+
POSTGRES_DB: murfey_test_db
36+
POSTGRES_PASSWORD: psql_pwd
37+
POSTGRES_USER: psql_user
38+
ports:
39+
5432: 5432
40+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
41+
3242
steps:
3343
- uses: actions/checkout@v4
3444
- name: Use Python ${{ matrix.python-version }}
@@ -74,7 +84,7 @@ jobs:
7484
mysql-version: "11.3"
7585
auto-start: false
7686

77-
- name: Set up test database
87+
- name: Set up test ipsyb database
7888
run: |
7989
set -eu
8090
cp ".github/workflows/config/my.cnf" .my.cnf
@@ -99,10 +109,22 @@ jobs:
99109
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api_sqlalchemy@'%' IDENTIFIED BY 'password_5678'; GRANT SELECT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT INSERT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT UPDATE ON ispybtest.* to ispyb_api_sqlalchemy@'%';"
100110
rm .my.cnf
101111
112+
- name: Connect to PostgreSQL
113+
run: node client.js
114+
env:
115+
POSTGRES_HOST: postgres
116+
POSTGRES_PORT: 5432
117+
102118
- name: Check RabbitMQ is alive
103119
run: wget -t 10 -w 1 http://127.0.0.1:15672 -O -
104120

105121
- name: Run tests
122+
env:
123+
POSTGRES_HOST: postgres
124+
POSTGRES_PORT: 5432
125+
POSTGRES_DB: murfey_test_db
126+
POSTGRES_PASSWORD: psql_pwd
127+
POSTGRES_USER: psql_user
106128
run: |
107129
export ISPYB_CREDENTIALS=".github/workflows/config/ispyb.cfg"
108130
PYTHONDEVMODE=1 pytest -v -ra --cov=murfey --cov-report=xml --cov-branch

0 commit comments

Comments
 (0)