-
Notifications
You must be signed in to change notification settings - Fork 4
121 lines (115 loc) · 3.95 KB
/
conductor-workflow.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
name: Test Debezium platform (conductor)
on:
push:
paths:
- "debezium-platform-conductor/**"
branches:
- main
pull_request:
paths:
- "debezium-platform-conductor/**"
branches:
- main
jobs:
build_cache:
name: "Update Dependencies"
runs-on: ubuntu-latest
defaults:
run:
working-directory: debezium-platform-conductor
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
repository: debezium/debezium
ref: main
path: debezium-platform-conductor/core
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
# GitHub actions seem to struggle returning actions/cache cache-hit
# Directly use the cache action here to control whether to fetch dependencies
- id: maven-cache-check
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
# Caches should be restored based on a logical order to minimize the build and test
# execution time. Here the logic is as follows:
# 1. Restore this PR's cache if the PR has previously been built
# 2. Restore the latest main cache if the core pom has not changed
# 3. Restore the latest main cache available
# This should minimize the download time required for updating dependencies
restore-keys: |
maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
maven-debezium-test-push-build-${{ hashFiles('core/**/pom.xml') }}
maven-debezium-test-push-build-
- name: Maven build core dependencies
run: >
./core/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
-Dmaven.javadoc.skip=true
-Dstyle.color=always
--no-transfer-progress
-T4
check_style:
name: "Checkstyle and Formatting"
needs: [ build_cache ]
runs-on: ubuntu-latest
defaults:
run:
working-directory: debezium-platform-conductor
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Maven Repository
id: cache-check
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
restore-keys: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
- name: "Checkstyle, Formatting, and Import Order Checks"
run: >
./mvnw -B -ntp process-sources checkstyle:checkstyle
-Dformat.formatter.goal=validate
-Dformat.imports.goal=check
-Dorg.slf4j.simpleLogger.showDateTime=true
-Dorg.slf4j.simpleLogger.dateTimeFormat="YYYY-MM-dd HH:mm:ss,SSS"
tests:
name: "Run tests"
needs: [ check_style]
runs-on: ubuntu-latest
defaults:
run:
working-directory: debezium-platform-conductor
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Cache Maven Repository
id: cache-check
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
restore-keys: maven-debezium-test-build-${{ hashFiles('core/**/pom.xml') }}
- name: Run tests
run: ./mvnw clean verify