You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by da...@apache.org on 2024/08/20 14:14:52 UTC

(kafka) 01/01: create workflow for fork PRs

This is an automated email from the ASF dual-hosted git repository.

davidarthur pushed a commit to branch gh-public-forks
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit 008bd19a6c3e03f7c6150d061eea4a31d6be15cb
Author: David Arthur <mu...@gmail.com>
AuthorDate: Tue Aug 20 10:13:53 2024 -0400

    create workflow for fork PRs
---
 .github/workflows/fork-pr.yml | 69 +++++++++++++++++++++++++++++++++++++++++++
 .github/workflows/pr.yml      |  4 +++
 2 files changed, 73 insertions(+)

diff --git a/.github/workflows/fork-pr.yml b/.github/workflows/fork-pr.yml
new file mode 100644
index 00000000000..ad51a3dc334
--- /dev/null
+++ b/.github/workflows/fork-pr.yml
@@ -0,0 +1,69 @@
+# 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: Public Pull Requests
+
+on:
+  pull_request_target:
+    types: [opened, synchronize, reopened]
+    branches: 'gh-*'
+    paths-ignore:
+      - '.github/*'
+      - '.asf.yaml'
+
+permissions:
+  # all other permissions are set to none
+  contents: read
+  pull-requests: read
+  packages: read
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
+jobs:
+  validate:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        java: [8, 21]
+    name: Compile and Check Java ${{ matrix.java }}
+    steps:
+      - name: Checkout code		# Checkout the PR's code
+        uses: actions/checkout@v4
+        with:
+          ref: ${{github.event.pull_request.head.ref}}
+          repository: ${{github.event.pull_request.head.repo.full_name}}
+          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
+        with:
+          gradle-version: wrapper
+          cache-read-only: true
+          # Cache downloaded JDKs in addition to the default directories.
+          gradle-home-cache-includes: |
+            caches
+            notifications
+            jdks
+          cache-cleanup: on-success
+      - name: Compile and validate
+        run: ./gradlew --build-cache --info check -x test
+
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index f9a773df363..c166c63301e 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -23,6 +23,10 @@ on:
     types: [opened, synchronize, reopened]
     branches: 'gh-*'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   validate:
     runs-on: ubuntu-latest