Skip to content

Commit f9b7f0a

Browse files
committed
fix(ci): hardcode postgres credentials and port in service container
1 parent f10979e commit f9b7f0a

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,35 +115,32 @@ jobs:
115115
needs.changes.outputs.backend == 'true' ||
116116
needs.changes.outputs.ci == 'true' ||
117117
github.event_name == 'workflow_dispatch'
118-
# Job-level env is evaluated before service containers start,
119-
# so these vars are available to the postgres service block below.
120-
# Using hardcoded CI-only test credentials that match the defaults in
121-
# tests/fixtures/settings.py — no secrets required for test DB access.
118+
# Hardcoded CI-only test credentials matching config/.env.test.
119+
# Service containers are provisioned before job steps run, so secrets/vars
120+
# context is not available here — literals are required.
122121
services:
123122
postgres:
124123
image: postgres:16-alpine
125124
env:
126125
POSTGRES_USER: postgres
127126
POSTGRES_PASSWORD: postgres
128-
POSTGRES_DB: test_myproject
127+
POSTGRES_DB: myproject_test
129128
options: >-
130129
--health-cmd pg_isready
131130
--health-interval 10s
132131
--health-timeout 5s
133132
--health-retries 5
134133
ports:
135-
- "${{ vars.POSTGRES_PORT }}:5432"
134+
- "5432:5432"
136135

137136

138137
steps:
139138
- uses: actions/checkout@v4
140139

141140
- name: Load test environment
142-
# Non-secret app vars (DATABASE_*, JWT_ALGORITHM, etc.) and
143-
# CI tooling vars (TF_VERSION, REGISTRY) from config/.env.test
141+
# Non-secret app vars (DATABASE_*, JWT_ALGORITHM, etc.) from config/.env.test
144142
run: |
145143
grep -v '^\s*#' config/.env.test | grep -v '^\s*$' >> $GITHUB_ENV
146-
echo "POSTGRES_PORT=${{ vars.POSTGRES_PORT }}" >> $GITHUB_ENV
147144
148145
- uses: actions/setup-python@v5
149146
with:

0 commit comments

Comments
 (0)