File tree Expand file tree Collapse file tree 3 files changed +29
-9
lines changed
Expand file tree Collapse file tree 3 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ name: Run with Postgres
33
44on :
55 workflow_dispatch :
6+ push :
7+ branches :
8+ - main
69
710jobs :
811 run :
912 runs-on : ubuntu-latest
10-
1113 services :
1214 postgres :
1315 image : postgres:18beta1-alpine
@@ -22,21 +24,27 @@ jobs:
2224 --health-timeout=5s
2325 --health-retries=5
2426 --name postgres
25- --entrypoint /usr/local/bin/postgres_custom.sh
2627 volumes :
2728 - /tmp/postgres_logs:/var/log/postgresql
28- - ./postgres_custom.sh:/usr/local/bin
29-
29+ - ${{ github.workspace }}/postgres/postgresql.conf:/var/lib/postgresql/data/postgresql.conf
3030 steps :
3131 - uses : actions/checkout@v3
32+ - name : Install Docker
33+ uses : docker/setup-buildx-action@v3
3234
33- - name : Wait for Postgres
34- run : |
35- until pg_isready -h localhost -U postgres; do sleep 1; done
35+ # - name: Run Postgres
36+ # run: |
37+ # docker run -v /tmp/postgres_logs:/var/log/postgresql -e POSTGRES_PASSWORD=123 -e POSTGRES_DB=testing --name postgres -p 5432:5432 -d postgres:18beta1-alpine postgres -c shared_preload_libraries=auto_explain -c auto_explain.log_min_duration=0 -c auto_explain.log_analyze=true -c auto_explain.log_verbose=true -c auto_explain.log_buffers=true -c auto_explain.log_format=json -c logging_collector=on -c log_directory='/var/log/postgresql' -c log_filename='postgres.log'
38+
39+ - name : List networks
40+ run : docker container inspect postgres
41+ # - name: Wait for Postgres
42+ # run: |
43+ # pg_isready -h localhost -U postgres;
3644
3745 - name : Apply SQL file
3846 run : |
39- psql -h localhost -U postgres -d testing -f bootstrap.sql
47+ psql -h 127.0.0.1 -U postgres -d testing -f bootstrap.sql
4048 env :
4149 PGPASSWORD : 123
4250
Original file line number Diff line number Diff line change 1- postgres \
1+ #! /bin/sh
2+ docker-entrypoint.sh \
3+ postgres \
24 -c shared_preload_libraries=auto_explain \
35 -c auto_explain.log_min_duration=0 \
46 -c auto_explain.log_analyze=true \
Original file line number Diff line number Diff line change 1+ listen_addresses='*'
2+ shared_preload_libraries=auto_explain
3+ auto_explain.log_min_duration=0
4+ auto_explain.log_analyze=true
5+ auto_explain.log_verbose=true
6+ auto_explain.log_buffers=true
7+ auto_explain.log_format=json
8+ logging_collector=on
9+ log_directory='/var/log/postgresql'
10+ log_filename='postgres.log'
You can’t perform that action at this time.
0 commit comments