Skip to content

Commit b167375

Browse files
committed
modified based on cr
1 parent 6c4d8ce commit b167375

File tree

3 files changed

+55
-79
lines changed

3 files changed

+55
-79
lines changed
Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
1-
################################################################################
2-
# Licensed to the Apache Software Foundation (ASF) under one
3-
# or more contributor license agreements. See the NOTICE file
4-
# distributed with this work for additional information
5-
# regarding copyright ownership. The ASF licenses this file
6-
# to you under the Apache License, Version 2.0 (the
7-
# "License"); you may not use this file except in compliance
8-
# with the License. You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
################################################################################
18-
name: Daily CI ON JDK 8
19-
on:
20-
schedule:
21-
# Run at 12:00 daily.
22-
- cron: "0 12 * * *"
23-
concurrency:
24-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
25-
cancel-in-progress: true
1+
# .github/workflows/ci-template.yaml
2+
name: CI Template
263

4+
on:
5+
workflow_call:
6+
inputs:
7+
java-version:
8+
required: true
9+
type: string
2710
jobs:
28-
build-on-jdk8:
11+
build-and-test:
12+
name: Build and Test (Java ${{ inputs.java-version }}, Module ${{ inputs.module }})
2913
runs-on: self-hosted
3014
strategy:
3115
fail-fast: false
@@ -34,21 +18,24 @@ jobs:
3418
steps:
3519
- name: Checkout code
3620
uses: actions/checkout@v2
37-
- name: Set up JDK 8
21+
- name: Set up JDK
3822
uses: actions/setup-java@v4
3923
with:
40-
java-version: '8'
24+
java-version: ${{ inputs.java-version }}
4125
distribution: 'temurin'
26+
- name: Determine Maven profile
27+
id: profile
28+
run: | echo "::set-output name=maven_profile::${{ (inputs.java-version == '8' && '-Pjava8-target') || ''
4229
- name: Build
4330
run: |
44-
mvn -T 1C -B clean install -DskipTests -Pjava8-target
31+
mvn -T 1C -B clean install -DskipTests ${{ steps.profile.outputs.maven_profile }}
4532
- name: Test
4633
timeout-minutes: 60
4734
run: |
4835
TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }})
4936
echo "github ref: ${{ github.ref }}"
5037
echo "Start testing modules: $TEST_MODULES"
51-
mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module }} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ github.workspace }}/tools/ci/log4j.properties -Pjava8-target
38+
mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module }} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ github.workspace }}/tools/ci/log4j.properties ${{ steps.profile.outputs.maven_profile }}
5239
env:
5340
MAVEN_OPTS: -Xmx4096m
5441
ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }}

.github/workflows/ci.yaml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ concurrency:
3232

3333
jobs:
3434
compile-on-jdk8:
35-
runs-on: self-hosted
36-
strategy:
37-
fail-fast: false
38-
matrix:
39-
module: [ core, flink ]
35+
name: "Compile Java 8"
36+
runs-on: ubuntu-latest
4037
steps:
4138
- name: Checkout code
4239
uses: actions/checkout@v2
@@ -50,47 +47,7 @@ jobs:
5047
mvn -T 1C -B clean install -DskipTests -Pjava8-target
5148
5249
build-on-jdk11:
53-
runs-on: self-hosted
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
module: [ core, flink ]
58-
steps:
59-
- name: Checkout code
60-
uses: actions/checkout@v2
61-
- name: Set up JDK 11
62-
uses: actions/setup-java@v4
63-
with:
64-
java-version: '11'
65-
distribution: 'temurin'
66-
- name: Build
67-
run: |
68-
mvn -T 1C -B clean install -DskipTests
69-
- name: Test
70-
timeout-minutes: 60
71-
run: |
72-
TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }})
73-
echo "github ref: ${{ github.ref }}"
74-
echo "Start testing modules: $TEST_MODULES"
75-
mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module }} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ github.workspace }}/tools/ci/log4j.properties
76-
env:
77-
MAVEN_OPTS: -Xmx4096m
78-
ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }}
79-
ARTIFACTS_OSS_REGION: ${{ secrets.ARTIFACTS_OSS_REGION }}
80-
ARTIFACTS_OSS_BUCKET: ${{ secrets.ARTIFACTS_OSS_BUCKET }}
81-
ARTIFACTS_OSS_ACCESS_KEY: ${{ secrets.ARTIFACTS_OSS_ACCESS_KEY }}
82-
ARTIFACTS_OSS_SECRET_KEY: ${{ secrets.ARTIFACTS_OSS_SECRET_KEY }}
83-
ARTIFACTS_OSS_STS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_STS_ENDPOINT }}
84-
ARTIFACTS_OSS_ROLE_ARN: ${{ secrets.ARTIFACTS_OSS_ROLE_ARN }}
85-
- name: Upload build logs
86-
uses: actions/upload-artifact@v4
87-
if: ${{ failure() }}
88-
with:
89-
name: logs-test-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }}
90-
path: ${{ runner.temp }}/fluss-logs/*
91-
- name: Upload JaCoCo coverage report
92-
uses: actions/upload-artifact@v4
93-
if: ${{ success() && github.ref == 'refs/heads/main' }}
94-
with:
95-
name: jacoco-report-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }}
96-
path: ${{ github.workspace }}/fluss-test-coverage/target/site/jacoco-aggregate/*
50+
name: "Build Java 11"
51+
uses: ./.github/workflows/ci-template.yaml
52+
with:
53+
java-version: "11"

.github/workflows/nightly.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
################################################################################
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
################################################################################
18+
name: Nightly
19+
on:
20+
schedule:
21+
# Run at 6:00 daily.
22+
- cron: "0 6 * * *"
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
build-on-jdk8:
29+
name: "Java 8"
30+
uses: ./.github/workflows/ci-template.yaml
31+
with:
32+
java-version: "8"

0 commit comments

Comments
 (0)