forked from debezium/debezium
-
Notifications
You must be signed in to change notification settings - Fork 2
178 lines (163 loc) · 6.76 KB
/
oracle-workflow-test.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Build and Test Oracle Connector
on:
push:
branches:
- main
- 1.*
- 2.*
paths:
- 'support/checkstyle/**'
- 'debezium-api/**'
- 'debezium-ddl-parser/**'
- 'debezium-assembly-descriptors/**'
- 'debezium-core/**'
- 'debezium-embedded/**'
- 'debezium-connector-oracle/**'
- 'debezium-parent/pom.xml'
- 'debezium-bom/pom.xml'
- 'pom.xml'
- '.github/workflows/oracle-workflow-test.yml'
pull_request:
branches:
- main
- 1.*
- 2.*
paths:
- 'support/checkstyle/**'
- 'debezium-api/**'
- 'debezium-ddl-parser/**'
- 'debezium-assembly-descriptors/**'
- 'debezium-core/**'
- 'debezium-embedded/**'
- 'debezium-connector-oracle/**'
- 'debezium-parent/pom.xml'
- 'debezium-bom/pom.xml'
- 'pom.xml'
- '.github/workflows/oracle-workflow-test.yml'
jobs:
check:
name: Check Pull-Secrets
runs-on: ubuntu-latest
outputs:
HAS_QUAY_IO: ${{ steps.skip.outputs.HAS_QUAY_IO }}
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Check if author has Quay.io credentials
id: skip
env:
QUAY_IO_USERNAME: ${{ secrets.QUAY_IO_USERNAME }}
QUAY_IO_PASSWORD: ${{ secrets.QUAY_IO_PASSWORD }}
run: |
if [[ $QUAY_IO_USERNAME == '' ]] && [[ $QUAY_IO_PASSWORD == '' ]]; then
echo "HAS_QUAY_IO=false" >> $GITHUB_OUTPUT
else
echo "HAS_QUAY_IO=true" >> $GITHUB_OUTPUT
fi
test-connector:
name: Oracle Connector
runs-on: ubuntu-latest
needs: [check]
if: ${{ needs.check.outputs.HAS_QUAY_IO == 'true' }}
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
# This workflow uses its own dependency cache rather than the main debezium workflow cache because
# we explicitly want to trigger this build on pushes separate from the other workflow.
- name: Cache Maven Repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
# we do not explicitly base this on POM changes since we are explicitly targeting a single connector
# and the likelihood that lots of dependencies will change that impacts Oracle is significantly low
# compared to other parts of Debezium that rely on frameworks such as Quarkus.
key: maven-oracle-${{ steps.get-date.outputs.date }}
restore-keys: |
maven-oracle-${{ steps.get-date.outputs.date }}
- name: Build and Install Debezium dependencies
run: >
./mvnw clean install -pl debezium-bom,debezium-core,:debezium-ide-configs,:debezium-checkstyle,:debezium-revapi -am
-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 and Test Debezium Connector Oracle LogMiner
env:
QUAY_IO_USERNAME: ${{ secrets.QUAY_IO_USERNAME }}
QUAY_IO_PASSWORD: ${{ secrets.QUAY_IO_PASSWORD }}
run: >
./mvnw clean install -B -pl debezium-connector-oracle -am -Pinfinispan-buffer,oracle-docker,oracle-tests
-Ddocker.username="$QUAY_IO_USERNAME"
-Ddocker.password="$QUAY_IO_PASSWORD"
-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
# A GitHub worker only has so much space and currently when this stage of the job runs concurrently with the
# "test-connector" stage, we are facing a worker out of space problem. To attempt to combat this issue, the
# REST extension tests will run sequentially after the "test-connector" stage has concluded.
test-rest-extension:
name: Oracle Connect REST Extension
runs-on: ubuntu-latest
needs: [check, test-connector]
if: ${{ needs.check.outputs.HAS_QUAY_IO == 'true' }}
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y-%m")" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
# This workflow uses its own dependency cache rather than the main debezium workflow cache because
# we explicitly want to trigger this build on pushes separate from the other workflow.
- name: Cache Maven Repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
# we do not explicitly base this on POM changes since we are explicitly targeting a single connector
# and the likelihood that lots of dependencies will change that impacts Oracle is significantly low
# compared to other parts of Debezium that rely on frameworks such as Quarkus.
key: maven-oracle-${{ steps.get-date.outputs.date }}
restore-keys: |
maven-oracle-${{ steps.get-date.outputs.date }}
- name: Build and Install Debezium dependencies
run: >
./mvnw clean install -pl debezium-bom,debezium-core,:debezium-ide-configs,:debezium-checkstyle,:debezium-revapi -am
-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 and Test Debezium Connector Oracle REST Extension
env:
QUAY_IO_USERNAME: ${{ secrets.QUAY_IO_USERNAME }}
QUAY_IO_PASSWORD: ${{ secrets.QUAY_IO_PASSWORD }}
run: >
./mvnw clean install -B -pl debezium-connector-oracle -am -Poracle-tests,rest-assembly
-Dregistry.username="$QUAY_IO_USERNAME"
-Dregistry.password="$QUAY_IO_PASSWORD"
-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