Skip to content

Commit 62cc62e

Browse files
[FLINK-35309][cdc] Introduce CI checks for licenses and NOTICE
Co-authored-by: GOODBOY008 <gongzhongqiang@apache.org>
1 parent e452d66 commit 62cc62e

29 files changed

+3906
-154
lines changed

.github/workflows/flink_cdc.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,29 @@ env:
100100
jobs:
101101
license_check:
102102
runs-on: ubuntu-latest
103+
env:
104+
MVN_COMMON_OPTIONS: -U -B --no-transfer-progress
105+
MVN_BUILD_OUTPUT_FILE: "/tmp/mvn_build_output.out"
106+
MVN_VALIDATION_DIR: "/tmp/flink-validation-deployment"
103107
steps:
104108
- name: Check out repository code
105109
uses: actions/checkout@v4
106110
with:
107111
submodules: true
108-
- name: Set up Ruby environment
109-
uses: ruby/setup-ruby@v1
110-
with:
111-
ruby-version: '3.3'
112-
- name: Compiling jar packages
113-
run: mvn --no-snapshot-updates -B package -DskipTests
112+
- name: Build
113+
run: |
114+
set -o pipefail
115+
116+
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
117+
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
118+
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
119+
114120
- name: Run license check
115-
run: gem install rubyzip -v 2.3.0 && ./tools/ci/license_check.rb
121+
run: |
122+
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-license -N \
123+
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}"
116124
117125
compile_and_test:
118-
# Only run the CI pipeline for the flink-cdc-connectors repository
119-
# if: github.repository == 'apache/flink-cdc-connectors'
120126
runs-on: ubuntu-latest
121127
strategy:
122128
matrix:
@@ -135,15 +141,6 @@ jobs:
135141
"e2e"
136142
]
137143
timeout-minutes: 120
138-
env:
139-
MVN_COMMON_OPTIONS: -Dmaven.wagon.http.pool=false \
140-
-Dorg.slf4j.simpleLogger.showDateTime=true \
141-
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS \
142-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
143-
--no-snapshot-updates -B \
144-
--settings /home/vsts/work/1/s/tools/ci/google-mirror-settings.xml \
145-
-Dfast -Dlog.dir=/home/vsts/work/_temp/debug_files \
146-
-Dlog4j.configurationFile=file:///home/vsts/work/1/s/tools/ci/log4j.properties
147144
steps:
148145
- run: echo "Running CI pipeline for JDK version ${{ matrix.jdk }}"
149146

@@ -249,4 +246,4 @@ jobs:
249246
jcmd $java_pid GC.heap_info || true
250247
done
251248
fi
252-
exit 0
249+
exit 0

pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ limitations under the License.
4040
<module>flink-cdc-connect</module>
4141
<module>flink-cdc-runtime</module>
4242
<module>flink-cdc-e2e-tests</module>
43+
<module>tools/ci/flink-cdc-ci-tools</module>
4344
</modules>
4445

4546
<licenses>
@@ -675,6 +676,33 @@ limitations under the License.
675676
</execution>
676677
</executions>
677678
</plugin>
679+
<plugin>
680+
<groupId>org.codehaus.mojo</groupId>
681+
<artifactId>exec-maven-plugin</artifactId>
682+
<version>3.1.0</version>
683+
<executions>
684+
<execution>
685+
<id>check-license</id>
686+
<!-- manually called -->
687+
<phase>none</phase>
688+
<goals>
689+
<goal>java</goal>
690+
</goals>
691+
<configuration>
692+
<mainClass>org.apache.flink.cdc.tools.ci.licensecheck.LicenseChecker</mainClass>
693+
<includePluginDependencies>true</includePluginDependencies>
694+
<includeProjectDependencies>false</includeProjectDependencies>
695+
</configuration>
696+
</execution>
697+
</executions>
698+
<dependencies>
699+
<dependency>
700+
<groupId>org.apache.flink</groupId>
701+
<artifactId>flink-cdc-ci-tools</artifactId>
702+
<version>${revision}</version>
703+
</dependency>
704+
</dependencies>
705+
</plugin>
678706
</plugins>
679707
<pluginManagement>
680708
<plugins>

tools/ci/flink-cdc-ci-tools/pom.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.apache.flink</groupId>
27+
<artifactId>flink-cdc-parent</artifactId>
28+
<version>${revision}</version>
29+
<relativePath>../../..</relativePath>
30+
</parent>
31+
32+
<artifactId>flink-cdc-ci-tools</artifactId>
33+
<version>${revision}</version>
34+
35+
<properties>
36+
<japicmp.skip>true</japicmp.skip>
37+
</properties>
38+
39+
<dependencies>
40+
<dependency>
41+
<groupId>org.apache.flink</groupId>
42+
<artifactId>flink-annotations</artifactId>
43+
<version>${flink.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.apache.flink</groupId>
47+
<artifactId>flink-test-utils-junit</artifactId>
48+
<version>${flink.version}</version>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.apache.logging.log4j</groupId>
53+
<artifactId>log4j-slf4j-impl</artifactId>
54+
<version>${log4j.version}</version>
55+
<scope>compile</scope>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.apache.logging.log4j</groupId>
59+
<version>${log4j.version}</version>
60+
<artifactId>log4j-api</artifactId>
61+
<scope>compile</scope>
62+
</dependency>
63+
<dependency>
64+
<groupId>org.apache.logging.log4j</groupId>
65+
<version>${log4j.version}</version>
66+
<artifactId>log4j-core</artifactId>
67+
<scope>compile</scope>
68+
</dependency>
69+
</dependencies>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-deploy-plugin</artifactId>
76+
<configuration>
77+
<skip>true</skip>
78+
</configuration>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
</project>

0 commit comments

Comments
 (0)