-
Notifications
You must be signed in to change notification settings - Fork 12
114 lines (108 loc) · 4.17 KB
/
cross-maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# 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 Informix connector basing on either the `master` 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 `master` branch of Debezium's upstream core repository.
name: Cross Maven CI
on:
pull_request:
branches:
- main
- 1.*
- 2.*
paths-ignore:
- '*.md'
jobs:
build-core:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key-generator.outputs.cache-key }}
steps:
- 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@v4
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@v4
with:
repository: debezium/debezium
ref: ${{ github.base_ref }}
path: core
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Cache Maven packages
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
-DskipITs=true
-Dcheckstyle.skip=true
-Dformat.skip=true
-Drevapi.skip=true
# 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"
build-ifx:
needs: build-core
runs-on: ubuntu-latest
strategy:
matrix:
informix-plugin: [ "assembly,informix12", "assembly,informix14" ]
fail-fast: false
steps:
- name: Checkout informix repository
uses: actions/checkout@v4
with:
path: informix
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Cache Maven packages
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 }})
run: >
./informix/mvnw clean install -B -f informix/pom.xml
-P${{ matrix.informix-plugin }}
-Dformat.formatter.goal=validate
-Dformat.imports.goal=check
-Ddebezium.test.records.waittime=7
-Ddebezium.test.records.waittime.after.nulls=13
-DfailFlakyTests=false