Skip to content

Merge pull request #966 from pgdogdev/fix/replication_retry #3209

Merge pull request #966 from pgdogdev/fix/replication_retry

Merge pull request #966 from pgdogdev/fix/replication_retry #3209

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v6
- name: Install CI deps
run: bash integration/ci/install-deps.sh
# Compute the binary key before restoring rust-cache: rust-cache restores
# target/ build outputs that would otherwise change the key. Use the
# split cache actions so pgdog binaries are saved immediately after the
# build, before rust-cache's post-job cleanup prunes workspace binaries
# from target/{debug,release}.
- name: Compute cache key
id: cache-key
run: echo "key=pgdog-bin-${{ runner.os }}-$(bash integration/ci/cache-key.sh)" >> "$GITHUB_OUTPUT"
- name: Restore pgdog binaries
id: pgdog-bin
uses: actions/cache/restore@v5
with:
path: |
target/debug/pgdog
target/release/pgdog
key: ${{ steps.cache-key.outputs.key }}
- uses: Swatinem/rust-cache@v2
if: steps.pgdog-bin.outputs.cache-hit != 'true'
with:
prefix-key: build-v1
- name: Build (debug)
if: steps.pgdog-bin.outputs.cache-hit != 'true'
run: cargo build --bin pgdog
- name: Build (release)
if: steps.pgdog-bin.outputs.cache-hit != 'true'
run: cargo build --release --bin pgdog
- name: Save pgdog binaries
if: steps.pgdog-bin.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: |
target/debug/pgdog
target/release/pgdog
key: ${{ steps.cache-key.outputs.key }}
ci:
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: [build]
timeout-minutes: 30
continue-on-error: ${{ matrix.continue_on_error == true }}
strategy:
fail-fast: false
matrix:
include:
- { name: pgbench, script: integration/pgbench/run.sh }
- { name: schema-sync, script: integration/schema_sync/run.sh }
- { name: go, script: integration/go/run.sh }
- { name: js, script: integration/js/pg_tests/run.sh }
- { name: ruby, script: integration/ruby/run.sh }
- { name: java, script: integration/java/run.sh }
- { name: mirror, script: integration/mirror/run.sh }
- { name: sql, script: integration/sql/run.sh }
- { name: toxi, script: integration/toxi/run.sh }
- { name: rust, script: integration/rust/run.sh }
- { name: python, script: integration/python/run.sh }
- { name: complex, script: integration/complex/run.sh }
- { name: dry-run, script: integration/dry_run/run.sh }
- { name: copy-data, script: integration/copy_data/run.sh }
- { name: load-balancer, script: integration/load_balancer/run.sh }
- { name: tls, script: integration/tls/run.sh }
- { name: resharding, script: integration/resharding/run.sh }
# plugins/run.sh builds 4 plugin crates with cargo, so it needs
# the workspace target/ cache; the other entries just run the
# cached pgdog binary.
- { name: plugins, script: integration/plugins/run.sh, needs_rust_cache: true, continue_on_error: true }
env:
PGDOG_BIN: ${{ github.workspace }}/target/release/pgdog
steps:
- uses: actions/checkout@v6
- name: Install CI deps
run: bash integration/ci/install-deps.sh
- name: Compute cache key
id: cache-key
run: echo "key=pgdog-bin-${{ runner.os }}-$(bash integration/ci/cache-key.sh)" >> "$GITHUB_OUTPUT"
# rust-cache must run before the binary restore: it lays down a
# stale target/ that can otherwise wipe target/release/pgdog when
# cargo reconciles fingerprints during plugin builds.
- name: Restore Rust cache for plugin builds
if: matrix.needs_rust_cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: build-v1
- name: Restore pgdog binaries
uses: actions/cache/restore@v5
with:
path: |
target/debug/pgdog
target/release/pgdog
key: ${{ steps.cache-key.outputs.key }}
fail-on-cache-miss: true
- name: Setup dependencies
run: bash integration/ci/setup.sh --with-toxi
- name: Run ${{ matrix.name }}
run: bash ${{ matrix.script }}
- name: Ensure PgDog stopped
if: always()
run: bash integration/ci/ensure-pgdog-stopped.sh