From 3569c5fa5a034abfa892ba16d68407df69498ff6 Mon Sep 17 00:00:00 2001 From: BillionClaw Date: Tue, 17 Mar 2026 10:49:02 +0800 Subject: [PATCH] fix(ci): add PostgreSQL service to Docker publish workflow The Docker Hub Release workflow's test job was missing the PostgreSQL service required by the test suite. This caused the workflow to fail before building and pushing the Docker image, resulting in missing container images (e.g., v0.5.2). Add the PostgreSQL service configuration matching ci.yml: - PostgreSQL 16-alpine service container - Health check configuration - DATABASE_URL environment variable - Database initialization step Fixes #193 --- .github/workflows/docker-publish.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 7b145a1a..5b9a6c7d 100755 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -18,10 +18,32 @@ jobs: test: name: Pre-publish Tests runs-on: ubuntu-latest + services: + postgres: + image: postgres:16-alpine + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: oxicloud_test + ports: + - 5432:5432 + options: >- + --health-cmd "pg_isready -U postgres" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + DATABASE_URL: "postgres://postgres:postgres@localhost/oxicloud_test" steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + + - name: Initialize test database + run: psql -h localhost -U postgres -d oxicloud_test -f migrations/20260307000000_initial_schema.sql + env: + PGPASSWORD: postgres + - run: cargo test --workspace # Build and push multi-arch image in a single job