From 8d3c6470e288afbe2a0e2c8dd2fbb5343c3d3fc7 Mon Sep 17 00:00:00 2001 From: admclamb Date: Wed, 29 Apr 2026 22:05:24 -0400 Subject: [PATCH 1/2] Fix connection string --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbc1bd2..2dc7048 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,4 +27,4 @@ jobs: env: CONNECTION_STRING: ${{ secrets.DEV_CONNECTION_STRING }} run: | - dotnet run --project ./Database/Database.csproj "${CONNECTION_STRING}" --dev + dotnet run --project ./Database/Database.csproj --connectionString "${CONNECTION_STRING}" --dev From 2844526b90d717710abc14d2ee0b74a986f7c1d9 Mon Sep 17 00:00:00 2001 From: admclamb Date: Wed, 29 Apr 2026 22:15:56 -0400 Subject: [PATCH 2/2] update ci --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dc7048..df8cab7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,40 @@ on: push: branches: - master + pull_request: + branches: + - master + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: - build-and-run-dev: + build-and-validate-migrations: runs-on: ubuntu-latest + + services: + postgres: + image: postgres:17 + env: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U postgres" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + env: + PGPASSWORD: postgres + steps: - name: Checkout code uses: actions/checkout@v4 @@ -23,8 +53,24 @@ jobs: - name: Build run: dotnet build --configuration Release --no-restore - - name: Run dev fixtures (migration + --dev) - env: - CONNECTION_STRING: ${{ secrets.DEV_CONNECTION_STRING }} + - name: Install PostgreSQL client + run: sudo apt-get update && sudo apt-get install -y postgresql-client + + - name: Wait for PostgreSQL + run: | + until pg_isready -h localhost -p 5432 -U postgres; do + sleep 1 + done + + - name: Create CI databases + run: | + psql -h localhost -U postgres -d postgres -c "CREATE DATABASE algowars_ci;" + psql -h localhost -U postgres -d postgres -c "CREATE DATABASE algowars_ci_full;" + + - name: Validate schema/reference/system migrations + run: | + dotnet run --project ./Database/Database.csproj --configuration Release --no-build --connectionString "Host=localhost;Port=5432;Database=algowars_ci;Username=postgres;Password=postgres" + + - name: Validate bootstrap and dev fixtures run: | - dotnet run --project ./Database/Database.csproj --connectionString "${CONNECTION_STRING}" --dev + dotnet run --project ./Database/Database.csproj --configuration Release --no-build --connectionString "Host=localhost;Port=5432;Database=algowars_ci_full;Username=postgres;Password=postgres" --init --dev