refactor: update CI workflow to rename postgres service, adjust database configuration, and inline environment variables
This commit is contained in:
@@ -6,13 +6,6 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
env:
|
|
||||||
# WHY?: services are executed way before the env can be sourced from .env file
|
|
||||||
# NOTE: still inlining these values because of gitea misbehaving with env loads
|
|
||||||
DB_NAME: piku_test_db
|
|
||||||
DB_USER: test
|
|
||||||
DB_PASSWORD: password123
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-environment:
|
setup-environment:
|
||||||
name: Generate Certificates
|
name: Generate Certificates
|
||||||
@@ -69,10 +62,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: setup-environment
|
needs: setup-environment
|
||||||
services:
|
services:
|
||||||
postgres:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: piku_test_db
|
POSTGRES_DB: piku__test
|
||||||
POSTGRES_USER: test
|
POSTGRES_USER: test
|
||||||
POSTGRES_PASSWORD: password123
|
POSTGRES_PASSWORD: password123
|
||||||
ports:
|
ports:
|
||||||
@@ -99,17 +92,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cp ../.env.example ../.env
|
cp ../.env.example ../.env
|
||||||
uv sync
|
uv sync
|
||||||
|
export DB_NAME="piku__test"
|
||||||
- name: Lint & Test
|
export DB_USER="test"
|
||||||
run: |
|
export DB_PASSWORD="password123"
|
||||||
if [ "$GITEA_ACTIONS" = "true" ]; then
|
if [ "$GITEA_ACTIONS" = "true" ]; then
|
||||||
export DB_HOST="postgres"
|
export DB_HOST="db"
|
||||||
export DB_PORT="5432"
|
export DB_PORT="5432"
|
||||||
else
|
else
|
||||||
export DB_HOST="127.0.0.1"
|
export DB_HOST="127.0.0.1"
|
||||||
export DB_PORT="5442"
|
export DB_PORT="5442"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Lint & Test
|
||||||
|
run: |
|
||||||
uv run ruff check
|
uv run ruff check
|
||||||
uv run python manage.py test
|
uv run python manage.py test
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user