Skip to content

Commit

Permalink
Configuring for zope-product
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jan 26, 2021
1 parent 6b7d789 commit 2549caf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ on:

jobs:
build:
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: zope_sqlalchemy_tests
# Set health checks to wait until postgres has started
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
config:
Expand All @@ -27,10 +43,11 @@ jobs:
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- name: "Try PostgreSQL"
- name: "Configure PostgreSQL"
run: |
psql --version
psql
docker exec ${{ job.services.postgres.id }} sh -c 'echo "max_prepared_transactions=10" >> /var/lib/postgresql/data/postgresql.conf'
docker exec ${{ job.services.postgres.id }} sh -c 'cat /var/lib/postgresql/data/postgresql.conf'
echo "postgres" | psql -h localhost -U postgres -W -d zope_sqlalchemy_tests -c "SELECT pg_reload_conf();"
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
Expand Down
24 changes: 21 additions & 3 deletions .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,27 @@ additional-rules = [
]

[github-actions]
services = [
"postgres:",
" image: postgres:13",
" env:",
" POSTGRES_USER: postgres",
" POSTGRES_PASSWORD: postgres",
" POSTGRES_DB: zope_sqlalchemy_tests",
" # Set health checks to wait until postgres has started",
" options: >-",
" --mount type=tmpfs,destination=/var/lib/postgresql/data",
" --health-cmd pg_isready",
" --health-interval 10s",
" --health-timeout 5s",
" --health-retries 5",
" ports:",
" - 5432:5432",
]
steps-before-checkout = [
"- name: \"Try PostgreSQL\"",
"- name: \"Configure PostgreSQL\"",
" run: |",
" psql --version",
" psql",
" docker exec ${{ job.services.postgres.id }} sh -c 'echo \"max_prepared_transactions=10\" >> /var/lib/postgresql/data/postgresql.conf'",
" docker exec ${{ job.services.postgres.id }} sh -c 'cat /var/lib/postgresql/data/postgresql.conf'",
" echo \"postgres\" | psql -h localhost -U postgres -W -d zope_sqlalchemy_tests -c \"SELECT pg_reload_conf();\"",
]

0 comments on commit 2549caf

Please sign in to comment.