Skip to content

feat: Use KeepAlive to confirm LSNs #2935

feat: Use KeepAlive to confirm LSNs

feat: Use KeepAlive to confirm LSNs #2935

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'appveyor.xml'
- '.travis.yml'
- '.travis/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- '**/*.md'
- 'appveyor.xml'
- '.travis.yml'
- '.travis/**'
permissions:
contents: read
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners
# GitHub Actions does not support Docker, PostgreSQL server on Windows, macOS :(
concurrency:
# On master/release, we don't want any jobs cancelled so the sha is used to name the group
# On PR branches, we cancel the job if new commits are pushed
# More info: https://stackoverflow.com/a/68422069/253468
group: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release' ) && format('ci-main-{0}', github.sha) || format('ci-main-{0}', github.ref) }}
cancel-in-progress: true
jobs:
code-style:
name: 'Code style'
runs-on: ubuntu-latest
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_RUNNER_DEBUG: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: 'Set up JDK 8'
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- uses: burrunan/gradle-cache-action@v1
name: Verify code style
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
job-id: jdk17
arguments: autostyleCheck checkstyleAll jandex
linux-checkerframework:
name: 'CheckerFramework'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: 'Set up JDK 11'
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- uses: burrunan/gradle-cache-action@v1
name: Run CheckerFramework
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
read-only: ${{ matrix.os == 'self-hosted' }}
job-id: checker-jdk11
arguments: --scan --no-parallel --no-daemon -PenableCheckerframework classes
source-distribution-check:
name: 'Source distribution (JDK 11)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Start PostgreSQL
working-directory: docker/postgres-server
run: docker-compose up -d && docker-compose logs
- name: 'Set up JDK 11'
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- uses: burrunan/gradle-cache-action@v1
name: Prepare source distribution
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
with:
job-id: source-release-jdk11
arguments: --scan --no-parallel --no-daemon sourceDistribution -Ppgjdbc.version=1.0 -Prelease
- name: Verify source distribution
working-directory: pgjdbc/build/distributions
run: |
tar xzf postgresql-1.0-jdbc-src.tar.gz
cd postgresql-1.0-jdbc-src
mvn --batch-mode --fail-at-end --show-version verify
- name: Attach heap dump if any
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: pgjdbc-heapdump-source-distribution
path: pgjdbc/build/distributions/postgresql-1.0-jdbc-src/target/surefire-reports/*.hprof
matrix_prep:
name: Matrix Preparation
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
env:
MATRIX_JOBS: 5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- id: set-matrix
run: |
node .github/workflows/matrix.js
build-test:
name: '${{ matrix.name }}'
runs-on: ${{ matrix.os }}
needs: matrix_prep
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
env:
ACTIONS_STEP_DEBUG: true
ACTIONS_RUNNER_DEBUG: true
TZ: ${{ matrix.tz }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Start PostgreSQL PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }}
working-directory: docker/postgres-server
env:
PGV: ${{ matrix.pg_version }}
TZ: ${{ matrix.server_tz }}
XA: ${{ matrix.xa }}
SSL: ${{ matrix.ssl }}
SCRAM: ${{ matrix.scram }}
CREATE_REPLICAS: ${{ matrix.replication }}
# The below run command is long, however, it is intentional, and it makes the output nicer in GitHub UI
run: |
echo 'Starting PostgreSQL via docker-compose down; PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }} docker-compose up'
docker-compose down -v --rmi local || true
sed -i -r '/- (543[3-4]):\1/d' docker-compose.yml
docker-compose up -d
docker-compose logs
- name: 'Get test node ARCH'
run: echo "arch_name=$(uname -i)" >> $GITHUB_OUTPUT
id: get_arch_name
- name: Set up Java ${{ matrix.java_version }}, ${{ matrix.java_distribution }}
if: ${{ steps.get_arch_name.outputs.arch_name != 'aarch64' }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: ${{ matrix.java_distribution }}
architecture: x64
- name: 'Setup JDK ${{ matrix.java_version }} on ARM64'
if: ${{ steps.get_arch_name.outputs.arch_name == 'aarch64' }}
uses: AdoptOpenJDK/install-jdk@v1
with:
impl: hotspot # or openj9
version: ${{ matrix.java_version }}
architecture: aarch64
- name: Prepare local properties
run: |
# See https://github.com/actions/runner/issues/409
cat <<EOF >ssltest.local.properties
enable_ssl_tests=${{ matrix.ssl == 'yes' && 'true' || 'false' }}
EOF
cat <<EOF >build.local.properties
preferQueryMode=${{ matrix.query_mode }}
EOF
- uses: burrunan/gradle-cache-action@v1
name: Test
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }}
_JAVA_OPTIONS: ${{ matrix.extraJvmArgs }}
with:
read-only: ${{ matrix.os == 'self-hosted' }}
job-id: jdk${{ matrix.java_version }}
arguments: --scan --no-parallel --no-daemon jandex test ${{ matrix.extraGradleArgs }}
properties: |
includeTestTags=${{ matrix.includeTestTags }}
testExtraJvmArgs=${{ matrix.testExtraJvmArgs }}
- name: 'Install krb5 for GSS tests'
if: ${{ matrix.gss == 'yes' }}
run: |
sudo apt -y update
sudo apt -y install krb5-kdc krb5-admin-server libkrb5-dev postgresql
- name: 'Update hosts for GSS tests'
if: ${{ matrix.gss == 'yes' }}
run: |
sudo -- sh -c "echo 127.0.0.1 localhost auth-test-localhost.postgresql.example.com > /etc/hosts"
cat /etc/hosts
- uses: burrunan/gradle-cache-action@v1
if: ${{ matrix.deploy_to_maven_local }}
name: Deploy pgjdbc to mavenLocal
with:
read-only: ${{ matrix.os == 'self-hosted' }}
job-id: jdk${{ matrix.java_version }}
arguments: publishToMavenLocal -Ppgjdbc.version=1.0.0-dev-master -PskipJavadoc
- name: Attach heap dump if any
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: pgjdbc-heapdump
path: pgjdbc/*.hprof
- name: Test GSS
if: ${{ matrix.gss == 'yes' }}
run: |
cd test-gss
./gradlew assemble
./gradlew run
env:
KRB5CCNAME: /home/runner/work/pgjdbc/pgjdbc/test-gss/tmp_check/krb5cc
KRB5_CONFIG: /home/runner/work/pgjdbc/pgjdbc/test-gss/tmp_check/krb5.conf
KRB5_KDC_PROFILE: /home/runner/work/pgjdbc/pgjdbc/test-gss/tmp_check/kdc.conf
- name: Test anorm-sbt
if: ${{ matrix.check_anorm_sbt == 'yes' }}
run: |
# mkdir -p $HOME/.sbt/launchers/0.13.12
# curl -L -o $HOME/.sbt/launchers/0.13.12/sbt-launch.jar http://dl.bintray.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.12/sbt-launch.jar
cd test-anorm-sbt
sed -i "s/\"org.postgresql\" % \"postgresql\" % \"[^\"]*\"/\"org.postgresql\" % \"postgresql\" % \"1.0.0-dev-master-SNAPSHOT\"/" build.sbt
sbt test
- name: Cleanup Docker
if: ${{ always() }}
working-directory: docker/postgres-server
run: |
docker-compose ps
docker-compose down -v --rmi local