chia7712 commented on code in PR #16936:
URL: https://github.com/apache/kafka/pull/16936#discussion_r1723730979
##########
.github/workflows/pr.yml:
##########
@@ -68,35 +50,17 @@ jobs:
fail-fast: false
matrix:
java: [ 11, 17 ]
+ if: contains(github.ref, 'gh-') # For now, only run tests on "gh-*" PRs
name: JUnit tests Java ${{ matrix.java }}
steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- persist-credentials: false
- - name: Setup Java
- uses: actions/setup-java@v4
- with:
- distribution: temurin
- java-version: ${{ matrix.java }}
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
- env:
- GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
+ uses: ./.github/actions/setup-gradle
with:
- gradle-version: wrapper
- develocity-access-key: ${{ secrets.GE_ACCESS_TOKEN }}
- # Only write to the cache from trunk
- #cache-read-only: ${{ github.ref != 'refs/heads/trunk' }}
- cache-read-only: false
- # Cache downloaded JDKs in addition to the default directories.
- gradle-home-cache-includes: |
- caches
- notifications
- jdks
- cache-cleanup: on-success
- cache-overwrite-existing: true
+ java-version: ${{ matrix.java }}
+ gradle-cache-read-only: true
- name: Test
+ # Publish build scans for now. This will only work on PRs from
apache/kafka, not public forks.
Review Comment:
Do we open PRs from apache/kafka? it seems almost all PRs are from public
forks.
Also, the failed tests in PR phase are expected. Maybe publishing the scans
in CI phase is more acceptable since that is what running in code base.
##########
.github/workflows/pr.yml:
##########
@@ -32,33 +34,13 @@ jobs:
java: [8, 21]
Review Comment:
in the https://github.com/apache/kafka/pull/16936#issuecomment-2299395186,
you say PR will run compile check for all JDKs
##########
.github/workflows/ci.yml:
##########
@@ -0,0 +1,65 @@
+# 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.
+
+name: CI
+
+on:
+ push:
+ branches:
+ - 'trunk'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: false # Let each trunk commit finish a build
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ java: [8, 11, 17, 21]
+ name: Compile and Check Java ${{ matrix.java }}
+ steps:
+ - name: Setup Gradle
+ uses: ./.github/actions/setup-gradle
+ with:
+ java-version: ${{ matrix.java }}
+ gradle-cache-read-only: false
+ - name: Compile and validate
+ run: ./gradlew --build-cache --info --scan check -x test
+
+ test:
+ needs: validate
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ java: [ 11, 17 ]
+ name: JUnit tests Java ${{ matrix.java }}
+ steps:
+ - name: Setup Gradle
+ uses: ./.github/actions/setup-gradle
+ with:
+ java-version: ${{ matrix.java }}
+ gradle-cache-read-only: false
+ - name: Test
+ timeout-minutes: 180 # 3 hours
+ run: |
+ ./gradlew --build-cache --scan --continue \
+ -PtestLoggingEvents=started,passed,skipped,failed \
+ -PignoreFailures=true -PmaxParallelForks=2 \
+ -PmaxTestRetries=1 -PmaxTestRetryFailures=10 \
Review Comment:
Maybe we don't need retries in CI? That can helps us to find out more flaky
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]