74 lines
2.7 KiB
YAML
74 lines
2.7 KiB
YAML
name: Build Postgres Connector
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 1.*
|
|
paths:
|
|
- 'support/checkstyle/**'
|
|
- 'debezium-api/**'
|
|
- 'debezium-assembly-descriptors/**'
|
|
- 'debezium-core/**'
|
|
- 'debezium-embedded/**'
|
|
- 'debezium-connector-postgres/**'
|
|
- 'debezium-parent/pom.xml'
|
|
- 'debezium-bom/pom.xml'
|
|
- 'pom.xml'
|
|
- '.github/workflows/postgres-workflow.yml'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- 1.*
|
|
paths:
|
|
- 'support/checkstyle/**'
|
|
- 'debezium-api/**'
|
|
- 'debezium-assembly-descriptors/**'
|
|
- 'debezium-core/**'
|
|
- 'debezium-embedded/**'
|
|
- 'debezium-connector-postgres/**'
|
|
- 'debezium-parent/pom.xml'
|
|
- 'debezium-bom/pom.xml'
|
|
- 'pom.xml'
|
|
- '.github/workflows/postgres-workflow.yml'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
postgres-plugin: ["assembly", "assembly,wal2json-decoder", "assembly,postgres-14,pgoutput-decoder"]
|
|
steps:
|
|
- name: Checkout Action
|
|
uses: actions/checkout@v2
|
|
- name: Get Date
|
|
id: get-date
|
|
run: |
|
|
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
|
|
shell: bash
|
|
- name: Set up Java 17
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 17
|
|
- name: Rename Plugin
|
|
id: get-plugin
|
|
run: |
|
|
plugin_name=${{ matrix.postgres-plugin }}
|
|
if [[ $plugin_name == *','* ]]; then
|
|
plugin_name=$(echo $plugin_name | sed 's/,/-/g;')
|
|
fi
|
|
echo "::set-output name=plugin::$plugin_name"
|
|
- name: Cache Maven Repository
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.m2/repository
|
|
# refresh cache every month to avoid unlimited growth
|
|
key: maven-postgres-${{ steps.get-plugin.outputs.plugin }}-${{ steps.get-date.outputs.date }}
|
|
restore-keys: |
|
|
maven-postgres-${{ steps.get-plugin.outputs.plugin }}-${{ steps.get-date.outputs.date }}
|
|
- name: Run Formatting and Import Order Checks
|
|
run: mvn clean install -DskipTests=true -DskipITs=true -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
|
|
- name: Build Debezium Connector Postgres
|
|
run: mvn clean install -B -pl debezium-connector-postgres -am -P${{ matrix.postgres-plugin }} -Ddebezium.test.records.waittime=5 -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
|