From 3f5fb69369ba330efed2e93d241e17cd08dcbb73 Mon Sep 17 00:00:00 2001 From: Lars M Johansson Date: Wed, 5 Jun 2024 17:56:59 +0200 Subject: [PATCH] DBZ-7813 (cross-)maven actions --- .github/workflows/cross-maven.yml | 68 ++++++++++++++++----------- .github/workflows/maven.yml | 76 ++++++++++++++++++++----------- 2 files changed, 91 insertions(+), 53 deletions(-) diff --git a/.github/workflows/cross-maven.yml b/.github/workflows/cross-maven.yml index 939b45c..0049ebf 100644 --- a/.github/workflows/cross-maven.yml +++ b/.github/workflows/cross-maven.yml @@ -21,7 +21,7 @@ on: - '*.md' jobs: - build-core: + build_core: runs-on: ubuntu-latest outputs: cache-key: ${{ steps.cache-key-generator.outputs.cache-key }} @@ -39,6 +39,7 @@ jobs: 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@v4 @@ -46,6 +47,7 @@ jobs: 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@v4 @@ -53,65 +55,77 @@ jobs: repository: debezium/debezium ref: ${{ github.base_ref }} path: core - - name: Set up JDK + + - name: Set up Java uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - name: Cache Maven packages + + - name: Cache Maven Repository uses: actions/cache@v4 with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Maven build core - run: ./core/mvnw clean install -f core/pom.xml -am - -pl debezium-bom,debezium-core,debezium-embedded,debezium-storage/debezium-storage-file,debezium-storage/debezium-storage-kafka - -DskipTests=true + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }} + + - name: Build Debezium (Core) + run: > + ./core/mvnw clean install -B -ntp -f core/pom.xml + -pl debezium-assembly-descriptors,debezium-bom,debezium-core,debezium-embedded,:debezium-ide-configs,:debezium-checkstyle,:debezium-revapi + -am + -DskipTests=true -DskipITs=true -Dcheckstyle.skip=true -Dformat.skip=true -Drevapi.skip=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false + -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 - # This job builds and creates/restores the cache based on the hash of the POM files from the core + # This job builds and creates/restores the cache based on the hash of the POM files from the core # repository; therefore, we need to output this so that the matrix job can reuse this cache. - name: Generate Cache Key id: cache-key-generator - run: echo "cache-key=${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}" >> "$GITHUB_OUTPUT" + run: echo "cache-key=${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }}" >> "$GITHUB_OUTPUT" - build-ifx: - needs: build-core - runs-on: ubuntu-latest + build_informix: strategy: + # Runs each combination concurrently matrix: - informix-plugin: [ "assembly,informix12", "assembly,informix14" ] + profile: [ "assembly,informix12", "assembly,informix14" ] fail-fast: false + name: "Informix - ${{ matrix.profile }}" + needs: [ build_core ] + runs-on: ubuntu-latest steps: - - name: Checkout informix repository + - name: Checkout Action (Informix) uses: actions/checkout@v4 with: path: informix - - name: Set up JDK + + - name: Set up Java uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - name: Cache Maven packages + + - name: Cache Maven Repository uses: actions/cache@v4 with: - path: ~/.m2 - key: ${{ needs.build-core.outputs.cache-key }} - restore-keys: ${{ needs.build-core.outputs.cache-key }} - - name: Maven build Informix (${{ matrix.informix-plugin }}) + path: ~/.m2/repository + key: ${{ needs.build_core.outputs.cache-key }} + restore-keys: ${{ needs.build_core.outputs.cache-key }} + + - name: Build Informix run: > - ./informix/mvnw clean install -f informix/pom.xml - -P${{ matrix.informix-plugin }} + ./informix/mvnw clean install -B -ntp -f informix/pom.xml + -P${{ matrix.profile }} -Dformat.formatter.goal=validate -Dformat.imports.goal=check - -Ddebezium.test.records.waittime=16 - -Ddebezium.test.records.waittime.after.nulls=16 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false + -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 + -Ddebezium.test.records.waittime=7 + -Ddebezium.test.records.waittime.after.nulls=13 -DfailFlakyTests=false diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 05adb6e..e555c9e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -12,67 +12,91 @@ on: - 2.* - 3.* paths-ignore: - - '*.md' + - '*.md' jobs: - build-core: + build_core: runs-on: ubuntu-latest + outputs: + cache-key: ${{ steps.cache-key-generator.outputs.cache-key }} steps: - - name: Checkout core repository + - name: Checkout Action (Core) uses: actions/checkout@v4 with: repository: debezium/debezium ref: ${{ github.ref }} path: core - - name: Set up JDK + + - name: Set up Java uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - name: Cache Maven packages + + - name: Cache Maven Repository uses: actions/cache@v4 with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Maven build core - run: > - ./core/mvnw clean install -B -f core/pom.xml - -pl debezium-bom,debezium-core,debezium-embedded,debezium-storage/debezium-storage-file,debezium-storage/debezium-storage-kafka -am - -DskipTests=true + path: ~/.m2/repository + key: ${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }} + + - name: Build Debezium (Core) + run: > + ./core/mvnw clean install -B -ntp -f core/pom.xml + -pl debezium-assembly-descriptors,debezium-bom,debezium-core,debezium-embedded,:debezium-ide-configs,:debezium-checkstyle,:debezium-revapi + -am + -DskipTests=true -DskipITs=true -Dcheckstyle.skip=true -Dformat.skip=true -Drevapi.skip=true - build-ifx: - needs: build-core - runs-on: ubuntu-latest + -Dhttp.keepAlive=false + -Dmaven.wagon.http.pool=false + -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 + + # This job builds and creates/restores the cache based on the hash of the POM files from the core + # repository; therefore, we need to output this so that the matrix job can reuse this cache. + - name: Generate Cache Key + id: cache-key-generator + run: echo "cache-key=${{ runner.os }}-m2-${{ hashFiles('core/**/pom.xml') }}" >> "$GITHUB_OUTPUT" + + build_informix: strategy: + # Runs each combination concurrently matrix: - informix-plugin: [ "assembly,informix12", "assembly,informix14" ] + profile: [ "assembly,informix12", "assembly,informix14" ] fail-fast: false + name: "Informix - ${{ matrix.profile }}" + needs: [ build_core ] + runs-on: ubuntu-latest steps: - - name: Checkout informix repository + - name: Checkout Action (Informix) uses: actions/checkout@v4 with: path: informix - - name: Set up JDK + + - name: Set up Java uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - - name: Cache Maven packages + + - name: Cache Maven Repository uses: actions/cache@v4 with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Maven build Informix (${{ matrix.informix-plugin }}) + path: ~/.m2/repository + key: ${{ needs.build_core.outputs.cache-key }} + restore-keys: ${{ needs.build_core.outputs.cache-key }} + + - name: Build Informix run: > - ./informix/mvnw clean install -B -f informix/pom.xml - -P${{ matrix.informix-plugin }} + ./informix/mvnw clean install -B -ntp -f informix/pom.xml + -P${{ matrix.profile }} -Dformat.formatter.goal=validate -Dformat.imports.goal=check + -Dhttp.keepAlive=false + -Dmaven.wagon.http.pool=false + -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Ddebezium.test.records.waittime=7 -Ddebezium.test.records.waittime.after.nulls=13 -DfailFlakyTests=false