Support for engine filtering and multi connector engine debezium/dbz#2007 #242
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Copyright Debezium Authors | |
| # | |
| # Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Cross CI workflow is triggered on a `pull_request` event. | |
| # It builds the Debezium core before building the Debezium Quarkus Extensions basing on either the `main` branch or the `pull_request` branch. | |
| # If a `pull_request` with same branch name is present in the Debezium's upstream core repository, then the core build of this `pull_request` | |
| # will be based on `pull_request` branch of user's Debezium core repository. | |
| # Otherwise the core build of this `pull_request` will be based on the `main` branch of Debezium's upstream core repository. | |
| name: Debezium Quarkus PR | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - 1.* | |
| - 2.* | |
| - 3.* | |
| - 4.* | |
| paths-ignore: | |
| - '*.md' | |
| env: | |
| MAVEN_FULL_BUILD_PROJECTS: ":debezium-quarkus-extensions-parent,:debezium-quarkus-outbox-common-parent,:debezium-quarkus-outbox-common,:debezium-quarkus-outbox-deployment-common,:debezium-quarkus-outbox-parent,:debezium-quarkus-outbox,:debezium-quarkus-outbox-deployment,:debezium-quarkus-outbox-integration-tests,:debezium-quarkus-outbox-reactive-parent,:debezium-quarkus-outbox-reactive,:debezium-quarkus-outbox-reactive-deployment,:debezium-quarkus-outbox-reactive-integration-tests,:debezium-quarkus-parent,:debezium-quarkus-engine-spi-parent,:debezium-quarkus-engine-spi,:debezium-quarkus-engine-deployment-spi,:debezium-quarkus-engine-parent,:debezium-quarkus-engine,:debezium-quarkus-engine-deployment,:debezium-quarkus-agroal-parent,:debezium-quarkus-agroal,:debezium-quarkus-agroal-deployment,:debezium-quarkus-testsuite-parent,:debezium-quarkus-testsuite-deployment,:debezium-quarkus-testsuite-integration-tests,:debezium-quarkus-postgres-parent,:debezium-quarkus-postgres,:debezium-quarkus-postgres-deployment,:debezium-quarkus-postgres-integration-tests,:debezium-quarkus-mongodb-parent,:debezium-quarkus-mongodb,:debezium-quarkus-mongodb-deployment,:debezium-quarkus-mongodb-integration-tests,:debezium-quarkus-sqlserver-parent,:debezium-quarkus-sqlserver,:debezium-quarkus-sqlserver-deployment,:debezium-quarkus-sqlserver-integration-tests,:debezium-quarkus-mysql-parent,:debezium-quarkus-mysql,:debezium-quarkus-mysql-deployment,:debezium-quarkus-mysql-integration-tests,:debezium-quarkus-mariadb-parent,:debezium-quarkus-mariadb,:debezium-quarkus-mariadb-deployment,:debezium-quarkus-mariadb-integration-tests" | |
| jobs: | |
| build-debezium-quarkus-dependencies: | |
| name: "Build Debezium & Dependencies" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Debezium Quarkus Extensions repository | |
| uses: actions/checkout@v6 | |
| with: | |
| path: debezium-quarkus | |
| - name: Check if pull request branch exists in debezium main repository | |
| id: branch | |
| env: | |
| branch_name: ${{ github.head_ref }} | |
| run: | | |
| curl --silent -X "GET" https://api.github.com/repos/debezium/debezium/pulls | jq '.[] | {branch: .head.ref}' | jq -r '.branch' >> SORTED_PULLS.txt | |
| while IFS=" " read -r BRANCH; | |
| do | |
| if grep -q "$branch_name" <<< "$BRANCH"; then | |
| echo "BRANCH_FOUND=true" >> $GITHUB_OUTPUT | |
| fi | |
| done < SORTED_PULLS.txt | |
| - name: Checkout core repository with pull request branch | |
| if: ${{ steps.branch.outputs.BRANCH_FOUND == 'true' }} | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ github.event.pull_request.user.login }}/debezium | |
| ref: ${{ github.head_ref }} | |
| path: core | |
| - name: Checkout core repository with default base branch | |
| if: ${{ steps.branch.outputs.BRANCH_FOUND != 'true' }} | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: debezium/debezium | |
| ref: ${{ github.base_ref }} | |
| path: core | |
| - name: Checkout db2 repository with default base branch | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: debezium/debezium-connector-db2 | |
| path: db2 | |
| - name: Checkout informix repository with default base branch | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: debezium/debezium-connector-informix | |
| path: informix | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 21 | |
| - uses: debezium/debezium/.github/actions/maven-cache@main | |
| with: | |
| key: debezium-quarkus-PR-build-${{ hashFiles('debezium-quarkus/**/pom.xml') }} | |
| - name: Maven build core | |
| run: ./debezium-quarkus/mvnw clean install -f core/pom.xml -DskipTests -DskipITs -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 | |
| - name: Maven build db2 | |
| run: ./debezium-quarkus/mvnw clean install -f db2/pom.xml -DskipTests -DskipITs -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 | |
| - name: Maven build informix | |
| run: ./debezium-quarkus/mvnw clean install -f informix/pom.xml -DskipTests -DskipITs -Dformat.formatter.goal=validate -Dformat.imports.goal=check -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 | |
| # Checks that all commits contain sign-offs | |
| check-signed-commits: | |
| name: Check signed commits | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: debezium/dbz/.github/actions/check-dco@main | |
| check_style: | |
| name: "Checkstyle and Formatting" | |
| needs: [ check-signed-commits, build-debezium-quarkus-dependencies ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| - uses: debezium/debezium/.github/actions/checkstyle-format@main | |
| with: | |
| maven-cache-key: debezium-quarkus-PR-build-${{ hashFiles('**/pom.xml') }} | |
| # This job is responsible for inspecting the changes in the repository and setting specific output variables | |
| # that subsequent jobs can use to determine whether a particular job should be skipped or included. | |
| file_changes: | |
| name: "Detect repository changes" | |
| needs: [ check-signed-commits ] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| common-changed: ${{ steps.changed-files-common.outputs.any_changed }} | |
| outbox-changed: ${{ steps.changed-files-outbox.outputs.any_changed }} | |
| core-changed: ${{ steps.changed-files-core.outputs.any_changed }} | |
| testing-changed: ${{ steps.changed-files-testing.outputs.any_changed }} | |
| mongodb-changed: ${{ steps.changed-files-mongodb.outputs.any_changed }} | |
| mariadb-changed: ${{ steps.changed-files-mariadb.outputs.any_changed }} | |
| mysql-changed: ${{ steps.changed-files-mysql.outputs.any_changed }} | |
| postgresql-changed: ${{ steps.changed-files-postgresql.outputs.any_changed }} | |
| oracle-changed: ${{ steps.changed-files-oracle.outputs.any_changed }} | |
| sqlserver-changed: ${{ steps.changed-files-sqlserver.outputs.any_changed }} | |
| db2-changed: ${{ steps.changed-files-db2.outputs.any_changed }} | |
| hibernate-changed: ${{ steps.changed-files-hibernate-invalidation.outputs.any_changed }} | |
| changed_connectors: ${{ steps.aggregate.outputs.changed_connectors }} | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get modified files (Common) | |
| id: changed-files-common | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| pom.xml | |
| .mvn/** | |
| .github/actions/** | |
| .github/workflows/pr-build.yml | |
| - name: Get modified files (Outbox) | |
| id: changed-files-outbox | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-outbox/** | |
| debezium-quarkus-outbox-common/** | |
| debezium-quarkus-outbox-reactive/** | |
| - name: Get modified files (Core) | |
| id: changed-files-core | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-engine-spi-parent/** | |
| debezium-quarkus-parent/debezium-quarkus-engine-parent/** | |
| debezium-quarkus-parent/debezium-quarkus-agroal-parent/** | |
| - name: Get modified files (Testing) | |
| id: changed-files-testing | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-testsuite-parent/** | |
| - name: Get modified files (MongoDB) | |
| id: changed-files-mongodb | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-mongodb-parent/** | |
| - name: Get modified files (MySQL) | |
| id: changed-files-mysql | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-mysql-parent/** | |
| - name: Get modified files (MariaDB) | |
| id: changed-files-mariadb | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-mariadb-parent/** | |
| - name: Get modified files (PostgreSQL) | |
| id: changed-files-postgresql | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-postgresql-parent/** | |
| - name: Get modified files (Oracle) | |
| id: changed-files-oracle | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-oracle-parent/** | |
| - name: Get modified files (SQL Server) | |
| id: changed-files-sqlserver | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-sqlserver-parent/** | |
| - name: Get modified files (DB2) | |
| id: changed-files-db2 | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-parent/debezium-quarkus-sqlserver-parent/** | |
| - name: Get modified files (Hibernate Cache) | |
| id: changed-files-hibernate-invalidation | |
| uses: tj-actions/changed-files@v47.0.6 | |
| with: | |
| files: | | |
| debezium-quarkus-hibernate-cache-parent/** | |
| - name: Aggregate changes for Connector Matrix | |
| id: aggregate | |
| shell: bash | |
| run: | | |
| RUNTIME_EXTENSIONS=(mongodb mariadb mysql postgres oracle sqlserver db2) | |
| COMMON='${{ steps.changed-files-common.outputs.any_changed }}' | |
| CORE='${{ steps.changed-files-core.outputs.any_changed }}' | |
| TESTING='${{ steps.changed-files-testing.outputs.any_changed }}' | |
| # If any of the three is true -> run for all the extensions runtime | |
| if [[ "$COMMON" == 'true' || "$CORE" == 'true' || "$TESTING" == 'true' ]]; then | |
| changed=("${RUNTIME_EXTENSIONS[@]}") | |
| else | |
| changed=() | |
| [[ "${{ steps.changed-files-mongodb.outputs.any_changed }}" == 'true' ]] && changed+=("mongodb") | |
| [[ "${{ steps.changed-files-mariadb.outputs.any_changed }}" == 'true' ]] && changed+=("mariadb") | |
| [[ "${{ steps.changed-files-mysql.outputs.any_changed }}" == 'true' ]] && changed+=("mysql") | |
| [[ "${{ steps.changed-files-postgresql.outputs.any_changed }}" == 'true' ]] && changed+=("postgres") | |
| [[ "${{ steps.changed-files-oracle.outputs.any_changed }}" == 'true' ]] && changed+=("oracle") | |
| [[ "${{ steps.changed-files-sqlserver.outputs.any_changed }}" == 'true' ]] && changed+=("sqlserver") | |
| [[ "${{ steps.changed-files-db2.outputs.any_changed }}" == 'true' ]] && changed+=("db2") | |
| fi | |
| # Build JSON array: ["svc1","svc2",...] | |
| json="[$(printf '"%s",' "${changed[@]}" | sed 's/,$//')]" | |
| echo "changed_connectors=$json" >> "$GITHUB_OUTPUT" | |
| build-outbox: | |
| name: "Outbox Extension" | |
| needs: [ check_style, build-debezium-quarkus-dependencies, file_changes ] | |
| if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.outbox-changed == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| - uses: ./.github/actions/build-debezium-outbox | |
| with: | |
| maven-cache-key: debezium-quarkus-PR-build-${{ hashFiles('**/pom.xml') }} | |
| build-debezium-extension-runtime-core: | |
| name: "Debezium Quarkus Extensions Core" | |
| needs: [ check_style, build-debezium-quarkus-dependencies, file_changes ] | |
| if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.core-changed == 'true' || needs.file_changes.outputs.testing-changed == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| - uses: ./.github/actions/build-debezium-quarkus-runtime-core | |
| with: | |
| maven-cache-key: debezium-quarkus-PR-build-${{ hashFiles('**/pom.xml') }} | |
| build-runtime-extensions: | |
| name: "Debezium Quarkus Extensions Matrix" | |
| runs-on: ubuntu-latest | |
| needs: [ check_style, build-debezium-quarkus-dependencies, build-debezium-extension-runtime-core, file_changes ] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| maven-props: | |
| - quarkus.test.integration-test-profile=multi | |
| - native | |
| connectors: ${{ fromJSON(needs.file_changes.outputs.changed_connectors) }} | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| - uses: ./.github/actions/build-debezium-quarkus-runtime-extension | |
| with: | |
| maven-cache-key: debezium-quarkus-PR-build-${{ hashFiles('**/pom.xml') }} | |
| maven-props: ${{ matrix.maven-props }} | |
| connector: ${{ matrix.connectors }} | |
| multi-engine-timeout: ${{ matrix.connectors == 'oracle' && '120' || '30' }} | |
| build-hibernate-cache: | |
| name: "Hibernate Cache Invalidation Extension" | |
| needs: [ check_style, build-debezium-quarkus-dependencies, file_changes ] | |
| if: ${{ needs.file_changes.outputs.common-changed == 'true' || needs.file_changes.outputs.hibernate-changed == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Action | |
| uses: actions/checkout@v6 | |
| - uses: ./.github/actions/build-debezium-hibernate-cache | |
| with: | |
| maven-cache-key: debezium-quarkus-PR-build-${{ hashFiles('**/pom.xml') }} |