name: "postgres_flat Filer Store Tests" on: push: branches: [ master ] paths: - 'weed/**' - 'test/postgres_flat/**' - 'test/s3/versioning/**' - 'test/testutil/**' - 'test/volume_server/framework/**' - 'go.mod' - 'go.sum' - '.github/workflows/postgres-flat-tests.yml' - '.github/actions/fix-fusermount-setuid/**' pull_request: paths: - 'weed/**' - 'test/postgres_flat/**' - 'test/s3/versioning/**' - 'test/testutil/**' - 'test/volume_server/framework/**' - 'go.mod' - 'go.sum' - '.github/workflows/postgres-flat-tests.yml' - '.github/actions/fix-fusermount-setuid/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) }} permissions: contents: read jobs: postgres-flat: name: S3 and POSIX over postgres_flat runs-on: ubuntu-24.04 timeout-minutes: 30 services: postgres: image: postgres:17 env: POSTGRES_PASSWORD: postgres ports: - 5432:5432 options: >- --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 20 steps: - name: Checkout code uses: actions/checkout@v7 - name: Set up Go uses: actions/setup-go@v7 with: go-version-file: 'go.mod' cache: ${{ runner.environment == 'github-hosted' }} - name: Repair the fusermount3 setuid bit uses: ./.github/actions/fix-fusermount-setuid - name: Build SeaweedFS run: go build -o weed/weed -buildvcs=false ./weed - name: Run tests env: RUN_POSTGRES_TESTS: "1" WEED_BINARY: ${{ github.workspace }}/weed/weed run: go test -v -count=1 -timeout=20m ./test/postgres_flat/ versioning-suite: name: S3 versioning suite over postgres_flat runs-on: ubuntu-24.04 timeout-minutes: 30 services: postgres: image: postgres:17 env: POSTGRES_PASSWORD: postgres ports: - 5432:5432 options: >- --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 20 steps: - name: Checkout code uses: actions/checkout@v7 - name: Set up Go uses: actions/setup-go@v7 with: go-version-file: 'go.mod' cache: ${{ runner.environment == 'github-hosted' }} - name: Build SeaweedFS run: go build -o weed/weed -buildvcs=false ./weed - name: Start weed mini on postgres_flat run: | mkdir -p "$RUNNER_TEMP/config" "$RUNNER_TEMP/data" : > "$RUNNER_TEMP/config/security.toml" cat > "$RUNNER_TEMP/config/filer.toml" <<'EOF' [postgres_flat] enabled = true hostname = "127.0.0.1" port = 5432 username = "postgres" password = "postgres" database = "postgres" sslmode = "disable" EOF weed/weed -config_dir="$RUNNER_TEMP/config" mini -ip=127.0.0.1 -ip.bind=127.0.0.1 \ -dir="$RUNNER_TEMP/data" -s3.config="$GITHUB_WORKSPACE/docker/compose/s3.json" \ -webdav=false -admin.ui=false > "$RUNNER_TEMP/weed.log" 2>&1 & for i in $(seq 90); do curl -s -o /dev/null http://127.0.0.1:8333 && break; sleep 1; done curl -s -o /dev/null http://127.0.0.1:8333 || { cat "$RUNNER_TEMP/weed.log"; exit 1; } test "$(docker exec ${{ job.services.postgres.id }} psql -U postgres -Atc "SELECT count(*) FROM information_schema.columns WHERE table_name = 'filemeta' AND column_name = 'path'")" = 1 - name: Run the S3 versioning suite env: ENABLE_STRESS_TESTS: "true" run: go test -v -count=1 -timeout=25m ./test/s3/versioning/ - name: Show the server log if: failure() run: tail -200 "$RUNNER_TEMP/weed.log"