Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f6cae24
docs(specs): add GitHub releases distribution feature specification
willibrandon Jan 6, 2026
b072c5d
feat(ci): add GitHub Actions workflows and packaging infrastructure
willibrandon Jan 6, 2026
03da5d3
fix(ci): add libkrb5-dev for GSSAPI headers, use EDB binaries for Win…
willibrandon Jan 6, 2026
874fbd6
fix(build): add missing sys/stat.h include, revert Windows to Chocolatey
willibrandon Jan 6, 2026
ccbe03a
fix(ci): switch from macos-13 to macos-15 (macos-13 retired)
willibrandon Jan 6, 2026
42818f4
fix(compat): handle 3-arg ExecComputeStoredGenerated in PG13
willibrandon Jan 6, 2026
19c1b99
fix(ci): resolve Ubuntu linker, Windows pg_regress, and EDB install
willibrandon Jan 6, 2026
44cc94a
fix(test): add missing wait_slot_confirm_lsn in att_list test
willibrandon Jan 6, 2026
31c4431
fix(windows): export extension functions via .def file for PG13/PG14
willibrandon Jan 6, 2026
3ea6eea
perf(ci): use cached ZIP binaries for Windows PostgreSQL
willibrandon Jan 6, 2026
7e0c9b5
perf(ci): use Chocolatey for Windows PostgreSQL installation
willibrandon Jan 6, 2026
7c326a3
feat(ci): use self-hosted PostgreSQL binaries for Windows CI
willibrandon Jan 6, 2026
d5a507c
fix(windows): export _PG_init and _PG_output_plugin_init for shared_p…
willibrandon Jan 6, 2026
333a4dc
fix(build): filter GCC-specific flags when compiling with Clang
willibrandon Jan 7, 2026
520c1db
fix(compat): include reorderbuffer.h to prevent macro redefinition wa…
willibrandon Jan 7, 2026
0c7e49c
docs(tasks): mark 67/71 tasks complete for github-releases feature
willibrandon Jan 7, 2026
ba82a85
fix(release): sync release workflow with CI workflow
willibrandon Jan 7, 2026
71ea554
fix(release): use macos-13 for x64 builds (macos-15 is ARM64)
willibrandon Jan 7, 2026
11245cd
fix(release): use macos-15-intel for x64, handle .so/.dylib on macOS
willibrandon Jan 7, 2026
1b5e132
fix(release): remove x64 macOS builds (ARM64 only for 2026)
willibrandon Jan 7, 2026
59844d7
fix(ci): restore macos-15-intel for x64 builds per spec FR-005
willibrandon Jan 7, 2026
8202a1f
fix(msi): use valid GUIDs for UpgradeCode, update manufacturer
willibrandon Jan 7, 2026
a2941e5
fix(msi): add WixToolset.UI.wixext extension for install dialogs
willibrandon Jan 7, 2026
e41341c
fix(msi): install WixToolset.UI.wixext before build
willibrandon Jan 7, 2026
4e95bc1
fix(msi): use WiX 5.0.2 with matching UI extension version
willibrandon Jan 7, 2026
d0d0bc0
fix(msi): use unique Action names for SetProperty to avoid duplicates
willibrandon Jan 7, 2026
3da1532
fix(msi): use ControlDir for pglogical.control (CMake puts it in buil…
willibrandon Jan 7, 2026
91225dd
chore(build): add clangd config and fix CMake library search paths
willibrandon Jan 7, 2026
168f227
fix(cmake): add PG_BINDIR as fallback path for pg_regress
willibrandon Jan 7, 2026
4d1e65b
fix(msi): use paths relative to .wxs file location, not working direc…
willibrandon Jan 7, 2026
5ef463f
fix(windows): reduce WaitLatch timeouts to prevent test timeouts
willibrandon Jan 7, 2026
eb7588c
fix(status): check sync status when worker not running to report accu…
willibrandon Jan 7, 2026
6e7f61a
fix(windows): improve status reporting and CI artifact capture
willibrandon Jan 7, 2026
3055202
fix(windows): add timing buffer for apply_delay to fix flaky test
willibrandon Jan 8, 2026
637b5f1
fix(status): check sync status when worker not running to report accu…
willibrandon Jan 8, 2026
c596432
fix(manager): eliminate race conditions causing flaky init test
willibrandon Jan 8, 2026
b033082
fix(ci): update paths for regression test results and logs
willibrandon Jan 8, 2026
a99602f
chore(ci): drop PG 13/14 and Intel Mac, use macos-26, fix artifacts
willibrandon Jan 8, 2026
878da43
fix(manager): add delay before checking/upgrading extension version t…
willibrandon Jan 8, 2026
17f7e4c
fix(windows): correct WiX path resolution for MSI builds
willibrandon Jan 8, 2026
3f38a70
fix(windows): resolve MSI SQL file harvesting and version warnings
willibrandon Jan 8, 2026
a9ec514
fix(windows): fail release if MSI installation fails
willibrandon Jan 8, 2026
23cd6fa
chore(tasks): mark release workflow and MSI installer tests as complete
willibrandon Jan 8, 2026
88e6b3c
chore(tasks): mark install.sh validation and quickstart checklist as …
willibrandon Jan 8, 2026
5268b92
docs(claude): add release process and CI/CD documentation
willibrandon Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 262 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
# CI Workflow for pglogical
#
# Runs on:
# - Push to REL2_x_STABLE and windows-build branches
# - Pull requests targeting REL2_x_STABLE
#
# Build matrix: PostgreSQL 15-18 x (Ubuntu, Windows, macOS ARM64)
# Tests: Regression tests run on all platforms

name: CI Tests

on:
push:
branches:
- REL2_x_STABLE
- windows-build
pull_request:
branches:
- REL2_x_STABLE

permissions:
contents: read
checks: write

jobs:
build:
name: PG ${{ matrix.pg-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
pg-version: [15, 16, 17, 18]
os: [ubuntu-latest, windows-2022, macos-26]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

# ============================================================
# Linux: Install PostgreSQL from official APT repository
# ============================================================
- name: Install PostgreSQL (Linux)
if: runner.os == 'Linux'
run: |
# Add PostgreSQL APT repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

# Install PostgreSQL server, development files, and build dependencies
# Libraries required for pglogical_create_subscriber linking:
# libkrb5-dev (GSSAPI), libselinux1-dev, libxslt1-dev, libpam0g-dev, libnuma-dev
sudo apt-get install -y postgresql-${{ matrix.pg-version }} postgresql-server-dev-${{ matrix.pg-version }} \
libkrb5-dev libselinux1-dev libxslt1-dev libpam0g-dev libnuma-dev

# Add PostgreSQL bin to PATH
echo "/usr/lib/postgresql/${{ matrix.pg-version }}/bin" >> $GITHUB_PATH

# ============================================================
# macOS: Install PostgreSQL from Homebrew
# ============================================================
- name: Install PostgreSQL (macOS)
if: runner.os == 'macOS'
run: |
# Install PostgreSQL from Homebrew
brew install postgresql@${{ matrix.pg-version }}

# Determine Homebrew prefix (Intel vs ARM64)
if [[ "$(uname -m)" == "arm64" ]]; then
BREW_PREFIX="/opt/homebrew"
else
BREW_PREFIX="/usr/local"
fi

# Add PostgreSQL bin to PATH
echo "${BREW_PREFIX}/opt/postgresql@${{ matrix.pg-version }}/bin" >> $GITHUB_PATH

# ============================================================
# Windows: Install PostgreSQL from self-hosted binaries (fast)
# Binaries hosted on GitHub releases to avoid slow EDB downloads
# ============================================================
- name: Cache PostgreSQL (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v4
id: pg-cache
with:
path: C:\pgsql
key: postgresql-${{ matrix.pg-version }}-windows-x64-v1

- name: Install PostgreSQL (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
$pgMajor = "${{ matrix.pg-version }}"
$pgPath = "C:\pgsql"

# Check cache first
if (Test-Path "$pgPath\bin\pg_config.exe") {
Write-Host "PostgreSQL $pgMajor found in cache"
} else {
# Download from self-hosted GitHub release
$zipUrl = "https://github.com/willibrandon/pglogical/releases/download/pg-binaries/postgresql-$pgMajor-windows-x64.zip"
$zipPath = "$env:TEMP\postgresql.zip"

Write-Host "Downloading PostgreSQL $pgMajor from $zipUrl"
Invoke-WebRequest -Uri $zipUrl -OutFile $zipPath -UseBasicParsing

Write-Host "Extracting PostgreSQL $pgMajor..."
Expand-Archive -Path $zipPath -DestinationPath "C:\" -Force
Remove-Item $zipPath -Force
}

if (-not (Test-Path "$pgPath\bin\pg_config.exe")) {
Write-Error "PostgreSQL $pgMajor not found at $pgPath"
exit 1
}

# Add to PATH
echo "$pgPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

Write-Host "PostgreSQL $pgMajor ready at $pgPath"

# ============================================================
# Verify pg_config is available
# ============================================================
- name: Verify pg_config
shell: bash
run: |
echo "PostgreSQL version:"
pg_config --version
echo ""
echo "PostgreSQL paths:"
echo " pkglibdir: $(pg_config --pkglibdir)"
echo " sharedir: $(pg_config --sharedir)"
echo " includedir-server: $(pg_config --includedir-server)"

# ============================================================
# Build: Linux and macOS use make
# ============================================================
- name: Build extension (Linux/macOS)
if: runner.os != 'Windows'
run: |
make clean all

# ============================================================
# Build: Windows uses CMake with Visual Studio 2022
# ============================================================
- name: Build extension (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Get pg_config path from self-hosted binaries
$pgConfig = "C:\pgsql\bin\pg_config.exe"

# Create build directory
New-Item -ItemType Directory -Force -Path build
Set-Location build

# Configure with CMake
cmake -G "Visual Studio 17 2022" `
-DPG_CONFIG="$pgConfig" `
..

# Build
cmake --build . --config Release

# ============================================================
# Test: Run regression tests (Linux)
# ============================================================
- name: Run regression tests (Linux)
if: runner.os == 'Linux'
run: |
# PGXS has a double-install issue: MODULE_big and MODULES both trigger
# install-lib. Work around by staging to temp dir then copying.
export DESTDIR=/tmp/pglogical-stage
make install DESTDIR=/tmp/pglogical-stage
sudo cp -rf /tmp/pglogical-stage/* /

# Run regression tests
make check

# ============================================================
# Test: Run regression tests (macOS)
# ============================================================
- name: Run regression tests (macOS)
if: runner.os == 'macOS'
run: |
# On macOS with Homebrew, the extension directories are writable
# and DESTDIR staging has issues with symlinks, so install directly
sudo make install

# Run regression tests
make check

# ============================================================
# Test: Run regression tests (Windows)
# ============================================================
- name: Run regression tests (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
# Install extension first
Set-Location build
cmake --build . --config Release --target install

# Run regression tests using CMake target
cmake --build . --config Release --target check

# ============================================================
# Upload test artifacts on failure
# ============================================================
- name: Upload regression test results on failure (Linux/macOS)
if: failure() && runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: regression-results-pg${{ matrix.pg-version }}-${{ matrix.os }}
path: |
regression_output/
tmp_check/log/
retention-days: 7

- name: Upload regression test results on failure (Windows)
if: failure() && runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: regression-results-pg${{ matrix.pg-version }}-${{ matrix.os }}
path: |
regression_output/
build/tmp_check/log/
retention-days: 7

# ============================================================
# Add build status to workflow summary
# ============================================================
- name: Add to job summary
if: always()
shell: bash
run: |
echo "## Build Status: PG ${{ matrix.pg-version }} on ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ job.status }}" == "success" ]; then
echo "✅ Build and tests passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Build or tests failed" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "- PostgreSQL: ${{ matrix.pg-version }}" >> $GITHUB_STEP_SUMMARY
echo "- Platform: ${{ matrix.os }}" >> $GITHUB_STEP_SUMMARY
echo "- Runner OS: ${{ runner.os }}" >> $GITHUB_STEP_SUMMARY

# Show regression diffs if test failed
if [ -f "regression_output/regression.diffs" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Regression Diffs" >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
cat regression_output/regression.diffs >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
Loading