Skip to content

Commit

Permalink
[FLINK-35309][cdc] Introduce CI checks for licenses and NOTICE
Browse files Browse the repository at this point in the history
Co-authored-by: GOODBOY008 <[email protected]>
  • Loading branch information
PatrickRen and GOODBOY008 committed May 10, 2024
1 parent e452d66 commit 62cc62e
Show file tree
Hide file tree
Showing 29 changed files with 3,906 additions and 154 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/flink_cdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,29 @@ env:
jobs:
license_check:
runs-on: ubuntu-latest
env:
MVN_COMMON_OPTIONS: -U -B --no-transfer-progress
MVN_BUILD_OUTPUT_FILE: "/tmp/mvn_build_output.out"
MVN_VALIDATION_DIR: "/tmp/flink-validation-deployment"
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Compiling jar packages
run: mvn --no-snapshot-updates -B package -DskipTests
- name: Build
run: |
set -o pipefail
mvn clean deploy ${{ env.MVN_COMMON_OPTIONS }} -DskipTests \
-DaltDeploymentRepository=validation_repository::default::file:${{ env.MVN_VALIDATION_DIR }} \
| tee ${{ env.MVN_BUILD_OUTPUT_FILE }}
- name: Run license check
run: gem install rubyzip -v 2.3.0 && ./tools/ci/license_check.rb
run: |
mvn ${{ env.MVN_COMMON_OPTIONS }} exec:java@check-license -N \
-Dexec.args="${{ env.MVN_BUILD_OUTPUT_FILE }} $(pwd) ${{ env.MVN_VALIDATION_DIR }}"
compile_and_test:
# Only run the CI pipeline for the flink-cdc-connectors repository
# if: github.repository == 'apache/flink-cdc-connectors'
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -135,15 +141,6 @@ jobs:
"e2e"
]
timeout-minutes: 120
env:
MVN_COMMON_OPTIONS: -Dmaven.wagon.http.pool=false \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss.SSS \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
--no-snapshot-updates -B \
--settings /home/vsts/work/1/s/tools/ci/google-mirror-settings.xml \
-Dfast -Dlog.dir=/home/vsts/work/_temp/debug_files \
-Dlog4j.configurationFile=file:///home/vsts/work/1/s/tools/ci/log4j.properties
steps:
- run: echo "Running CI pipeline for JDK version ${{ matrix.jdk }}"

Expand Down Expand Up @@ -249,4 +246,4 @@ jobs:
jcmd $java_pid GC.heap_info || true
done
fi
exit 0
exit 0
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ limitations under the License.
<module>flink-cdc-connect</module>
<module>flink-cdc-runtime</module>
<module>flink-cdc-e2e-tests</module>
<module>tools/ci/flink-cdc-ci-tools</module>
</modules>

<licenses>
Expand Down Expand Up @@ -675,6 +676,33 @@ limitations under the License.
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>check-license</id>
<!-- manually called -->
<phase>none</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.apache.flink.cdc.tools.ci.licensecheck.LicenseChecker</mainClass>
<includePluginDependencies>true</includePluginDependencies>
<includeProjectDependencies>false</includeProjectDependencies>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-cdc-ci-tools</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
82 changes: 82 additions & 0 deletions tools/ci/flink-cdc-ci-tools/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.flink</groupId>
<artifactId>flink-cdc-parent</artifactId>
<version>${revision}</version>
<relativePath>../../..</relativePath>
</parent>

<artifactId>flink-cdc-ci-tools</artifactId>
<version>${revision}</version>

<properties>
<japicmp.skip>true</japicmp.skip>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-annotations</artifactId>
<version>${flink.version}</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<version>${log4j.version}</version>
<artifactId>log4j-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<version>${log4j.version}</version>
<artifactId>log4j-core</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 62cc62e

Please sign in to comment.