You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2023/01/04 13:04:22 UTC
[pulsar] 01/01: [feat][ci] Add integration to ge.apache.org Gradle Enterprise server
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch experiment-ge.apache.org
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit d368952c00581c6d7493343b2624808d26a93b00
Author: Lari Hotari <lh...@apache.org>
AuthorDate: Wed Jan 4 15:01:48 2023 +0200
[feat][ci] Add integration to ge.apache.org Gradle Enterprise server
---
.github/actions/gradle-enterprise/action.yml | 32 +++++++++++++++++
.github/workflows/ci-maven-cache-update.yaml | 5 +++
.github/workflows/ci-owasp-dependency-check.yaml | 7 +++-
.github/workflows/pulsar-ci-flaky.yaml | 5 +++
.github/workflows/pulsar-ci.yaml | 40 +++++++++++++++++++++
.mvn/ge-extensions.xml | 34 ++++++++++++++++++
.mvn/gradle-enterprise-custom-user-data.groovy | 31 +++++++++++++++++
.mvn/gradle-enterprise.xml | 44 ++++++++++++++++++++++++
8 files changed, 197 insertions(+), 1 deletion(-)
diff --git a/.github/actions/gradle-enterprise/action.yml b/.github/actions/gradle-enterprise/action.yml
new file mode 100644
index 00000000000..5d2d42b28f9
--- /dev/null
+++ b/.github/actions/gradle-enterprise/action.yml
@@ -0,0 +1,32 @@
+#
+# 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: Configure Gradle Enterprise integration
+description: Configure Gradle Enterprise when secret GE_ACCESS_TOKEN is available
+runs:
+ using: composite
+ steps:
+ - run: |
+ if [[ -n "${{ secrets.GE_ACCESS_TOKEN }}" ]]; then
+ echo "::group::Configuring Gradle Enterprise for build"
+ cp .mvn/ge-extensions.xml .mvn/extensions.xml
+ echo "GRADLE_ENTERPRISE_ACCESS_KEY=${{ secrets.GE_ACCESS_TOKEN }}" >> $GITHUB_ENV
+ echo "::endgroup::"
+ fi
+ shell: bash
\ No newline at end of file
diff --git a/.github/workflows/ci-maven-cache-update.yaml b/.github/workflows/ci-maven-cache-update.yaml
index daba3dcc032..fb871e9e496 100644
--- a/.github/workflows/ci-maven-cache-update.yaml
+++ b/.github/workflows/ci-maven-cache-update.yaml
@@ -47,6 +47,8 @@ env:
jobs:
update-maven-dependencies-cache:
name: Update Maven dependency cache for ${{ matrix.name }}
+ env:
+ JOB_NAME: Update Maven dependency cache for ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 45
@@ -75,6 +77,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Detect changed files
if: ${{ github.event_name != 'schedule' }}
id: changes
diff --git a/.github/workflows/ci-owasp-dependency-check.yaml b/.github/workflows/ci-owasp-dependency-check.yaml
index 38bd7f9eec4..63cd3058428 100644
--- a/.github/workflows/ci-owasp-dependency-check.yaml
+++ b/.github/workflows/ci-owasp-dependency-check.yaml
@@ -28,7 +28,9 @@ env:
jobs:
run-owasp-dependency-check:
if: ${{ github.repository == 'apache/pulsar' }}
- name: Run OWASP Dependency Check
+ name: Run OWASP Dependency Check for ${{ matrix.name }}
+ env:
+ JOB_NAME: Run OWASP Dependency Check for ${{ matrix.name }}
runs-on: ubuntu-20.04
timeout-minutes: 45
strategy:
@@ -55,6 +57,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Cache local Maven repository
uses: actions/cache@v3
with:
diff --git a/.github/workflows/pulsar-ci-flaky.yaml b/.github/workflows/pulsar-ci-flaky.yaml
index 9c52cfe77d6..3c43bca3cc5 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -69,6 +69,8 @@ jobs:
build-and-test:
needs: preconditions
name: Flaky tests suite
+ env:
+ JOB_NAME: Flaky tests suite
runs-on: ubuntu-20.04
timeout-minutes: 100
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
@@ -79,6 +81,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 3741d3c8424..1945717ec83 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -75,6 +75,8 @@ jobs:
build-and-license-check:
needs: preconditions
name: Build and License check
+ env:
+ JOB_NAME: Build and License check
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
@@ -85,6 +87,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -145,6 +150,8 @@ jobs:
unit-tests:
name: CI - Unit - ${{ matrix.name }}
+ env:
+ JOB_NAME: CI - Unit - ${{ matrix.name }}
runs-on: ubuntu-20.04
timeout-minutes: ${{ matrix.timeout || 60 }}
needs: ['preconditions', 'build-and-license-check']
@@ -180,6 +187,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -281,6 +291,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -338,6 +351,7 @@ jobs:
needs: ['preconditions', 'pulsar-java-test-image']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI - Integration - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest
strategy:
fail-fast: false
@@ -379,6 +393,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -486,6 +503,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Install gh-actions-artifact-client.js
uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
@@ -508,6 +528,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -598,6 +621,7 @@ jobs:
needs: ['preconditions', 'pulsar-test-latest-version-image']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI - System - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest
strategy:
fail-fast: false
@@ -634,6 +658,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -726,6 +753,7 @@ jobs:
needs: [ 'preconditions', 'pulsar-test-latest-version-image' ]
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI Flaky - System - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest
strategy:
fail-fast: false
@@ -745,6 +773,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
@@ -847,6 +878,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Install gh-actions-artifact-client.js
uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
@@ -867,6 +901,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
@@ -899,6 +936,9 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name == 'pull_request' }}
diff --git a/.mvn/ge-extensions.xml b/.mvn/ge-extensions.xml
new file mode 100644
index 00000000000..5852f0f5bae
--- /dev/null
+++ b/.mvn/ge-extensions.xml
@@ -0,0 +1,34 @@
+<?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.
+
+-->
+<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
+ <extension>
+ <groupId>com.gradle</groupId>
+ <artifactId>gradle-enterprise-maven-extension</artifactId>
+ <version>1.16.1</version>
+ </extension>
+ <extension>
+ <groupId>com.gradle</groupId>
+ <artifactId>common-custom-user-data-maven-extension</artifactId>
+ <version>1.11.1</version>
+ </extension>
+</extensions>
diff --git a/.mvn/gradle-enterprise-custom-user-data.groovy b/.mvn/gradle-enterprise-custom-user-data.groovy
new file mode 100644
index 00000000000..1b3c47a0095
--- /dev/null
+++ b/.mvn/gradle-enterprise-custom-user-data.groovy
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+// Add Maven command line arguments
+if (System.env.MAVEN_CMD_LINE_ARGS) {
+ buildScan.value('Maven command line', "mvn ${System.env.MAVEN_CMD_LINE_ARGS}")
+}
+if (System.env.GITHUB_ACTIONS) {
+ buildScan.value('GitHub Actions Job name', System.env.JOB_NAME ?: System.env.GITHUB_JOB)
+ buildScan.value('GitHub Actions Event name', System.env.GITHUB_EVENT_NAME)
+ buildScan.value('GitHub Ref name', System.env.GITHUB_REF_NAME)
+ buildScan.link('GitHub Repository', "https://github.com/" + System.env.GITHUB_REPOSITORY)
+ buildScan.link('GitHub Actor', "https://github.com/" + System.env.GITHUB_ACTOR)
+ buildScan.link('GitHub Commit', "https://github.com/" + System.env.GITHUB_REPOSITORY + "/commits/" + System.env.GITHUB_SHA)
+}
\ No newline at end of file
diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml
new file mode 100644
index 00000000000..a7fe285840f
--- /dev/null
+++ b/.mvn/gradle-enterprise.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<!--
+
+ 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.
+
+-->
+<gradleEnterprise
+ xmlns="https://www.gradle.com/gradle-enterprise-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
+ <server>
+ <url>https://ge.apache.org</url>
+ </server>
+ <buildScan>
+ <capture>
+ <goalInputFiles>true</goalInputFiles>
+ </capture>
+ <obfuscation>
+ <ipAddresses>0.0.0.0</ipAddresses>
+ </obfuscation>
+ <publish>ALWAYS</publish>
+ <publishIfAuthenticated>true</publishIfAuthenticated>
+ <backgroundBuildScanUpload>#{isFalse(env['JENKINS_URL'])}</backgroundBuildScanUpload>
+ </buildScan>
+ <buildCache>
+ <local>
+ <enabled>true</enabled>
+ </local>
+ </buildCache>
+</gradleEnterprise>