removes 'docker run' usages
Some checks failed
Dotnet build and test / build (pull_request) Failing after 18s
Some checks failed
Dotnet build and test / build (pull_request) Failing after 18s
This commit is contained in:
parent
24e4d9f8a3
commit
737145dd2c
1 changed files with 14 additions and 26 deletions
|
|
@ -28,6 +28,20 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v5
|
image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v5
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 55432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd="pg_isready -U postgres -d postgres"
|
||||||
|
--health-interval=10s
|
||||||
|
--health-timeout=5s
|
||||||
|
--health-retries=5
|
||||||
steps:
|
steps:
|
||||||
- name: Clone yavsc
|
- name: Clone yavsc
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -51,32 +65,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "🏗️ Building the solution..."
|
echo "🏗️ Building the solution..."
|
||||||
cd /src/_src && dotnet build --verbosity normal
|
cd /src/_src && dotnet build --verbosity normal
|
||||||
- name: Start PostgreSQL
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
echo "🐘 Starting local PostgreSQL..."
|
|
||||||
if docker ps -a --format '{{.Names}}' | grep -qx 'yavsc-ci-postgres'; then
|
|
||||||
echo "PostgreSQL container already exists; restarting it"
|
|
||||||
docker rm -f yavsc-ci-postgres >/dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
docker run -d \
|
|
||||||
--name yavsc-ci-postgres \
|
|
||||||
-e POSTGRES_USER=postgres \
|
|
||||||
-e POSTGRES_PASSWORD=postgres \
|
|
||||||
-e POSTGRES_DB=postgres \
|
|
||||||
-p 55432:5432 \
|
|
||||||
postgres:16
|
|
||||||
for i in $(seq 1 40); do
|
|
||||||
if pg_isready -h 127.0.0.1 -p 55432 -U postgres >/dev/null 2>&1; then
|
|
||||||
echo "✅ PostgreSQL is ready"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "PostgreSQL not ready yet ($i/40)"
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
echo "❌ PostgreSQL did not become ready in time" >&2
|
|
||||||
docker logs yavsc-ci-postgres || true
|
|
||||||
exit 1
|
|
||||||
- name: Test
|
- name: Test
|
||||||
env:
|
env:
|
||||||
YAVSC_API_TEST_DB_PROVIDER: npgsql
|
YAVSC_API_TEST_DB_PROVIDER: npgsql
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue