Capture build scans on ge.apache.org to benefit from deep build insights (#1288)

* Capture build scans on ge.apache.org to benefit from deep build insights (#1)

* Add Develocity plugin and configure it to publish to Apache Develocity instance

* Add Develocity access token to CI jobs

* Use convention plugin to configure Develocity

* Add opt-in property

* Revert "Add opt-in property"

This reverts commit ff556b9764fd6b980b24082a3195ba3fbd22faf6.

* Improve variable name

* Use upper case i in CI abbreviation
This commit is contained in:
Alexey Venderov 2024-04-25 17:25:52 +02:00 committed by GitHub
parent 7deed41917
commit 763cdb64eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 105 additions and 0 deletions

View file

@ -16,6 +16,8 @@ jobs:
if: github.repository == 'apache/pekko'
strategy:
fail-fast: false
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -14,6 +14,8 @@ jobs:
check-code-style:
name: Check / Code Style
runs-on: ubuntu-22.04
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
@ -41,6 +43,8 @@ jobs:
pull-request-validation:
name: Check / Tests
runs-on: ubuntu-20.04
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -49,4 +49,6 @@ jobs:
sudo apt-get install graphviz
- name: Compile testClass&docs for all Scala versions
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: sbt ";+TestJdk9 / compile ; +compile:doc"

View file

@ -23,6 +23,8 @@ jobs:
uses: coursier/cache-action@v6
- name: Check headers
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
sbt \
-Dsbt.override.build.repos=false \

View file

@ -35,6 +35,8 @@ jobs:
uses: coursier/setup-action@v1
- name: Create the Pekko site
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dpekko.genjavadoc.enabled=true -Dpekko.genlicensereport.enabled=true "Javaunidoc/doc; Compile/unidoc; docs/paradox"

View file

@ -33,6 +33,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt cluster-metrics/test
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
sbt \
-Djava.security.egd=file:/dev/./urandom \
@ -82,6 +84,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt ${{ matrix.command }}
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
# note that this is not running any multi-jvm tests because multi-in-test=false
run: |-
sbt \
@ -127,6 +131,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: Compile and Test
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
# note that this is not running any multi-jvm tests because multi-in-test=false
run: |-
sbt \

View file

@ -40,6 +40,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt ${{ matrix.command }}
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
# note that this is not running any multi-jvm tests because multi-in-test=false
run: |-
sbt \

View file

@ -32,6 +32,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt cluster-metrics/test
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
sbt \
-Djava.security.egd=file:/dev/./urandom \
@ -90,6 +92,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt ${{ matrix.command }}
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
# note that this is not running any multi-jvm tests because multi-in-test=false
run: |-
sbt \
@ -114,6 +118,8 @@ jobs:
# full version from it.
scalaVersion: ["2.12", "2.13", "3.3"]
javaVersion: [8, 11, 17, 21]
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -54,6 +54,8 @@ jobs:
# TODO come up with a better way to control the version, possibly based on git tags
- name: Build Documentation
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
sbt -Dpekko.genjavadoc.enabled=true -Dpekko.genlicensereport.enabled=true "set ThisBuild / version := \"1.0.2\"; docs/paradox; unidoc"

View file

@ -32,6 +32,8 @@ jobs:
name: Publish 1.0 nightly
runs-on: ubuntu-20.04
if: github.repository == 'apache/pekko'
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -32,6 +32,8 @@ jobs:
name: Publish nightly
runs-on: ubuntu-20.04
if: github.repository == 'apache/pekko'
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

View file

@ -52,6 +52,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: Compile and run tests on Scala 3
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
# note that this is not running any multi-jvm tests (yet) because multi-in-test=false
run: |
sbt \

View file

@ -50,6 +50,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: Compile on Scala 3
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |
sbt \
"+~ 3 ${{ matrix.command }}"

View file

@ -34,6 +34,8 @@ jobs:
run: cp .jvmopts-ci .jvmopts
- name: sbt test
env:
DEVELOCITY_ACCESS_TOKEN: ${{ secrets.GE_ACCESS_TOKEN }}
run: |-
sbt \
-Djava.security.egd=file:/dev/./urandom \

View file

@ -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.
*/
import com.gradle.develocity.agent.sbt.DevelocityPlugin
import com.gradle.develocity.agent.sbt.DevelocityPlugin.autoImport.{
develocityConfiguration,
FlakyTestPolicy,
ProjectId,
Publishing
}
import sbt.{ url, AutoPlugin, Def, PluginTrigger, Plugins, Setting }
import sbt.Keys.insideCI
object PekkoDevelocityPlugin extends AutoPlugin {
private val ApacheDevelocityUrl = url("https://ge.apache.org")
private val PekkoProjectId = ProjectId("pekko")
private val ObfuscatedIPv4Address = "0.0.0.0"
override lazy val trigger: PluginTrigger = allRequirements
override lazy val requires: Plugins = DevelocityPlugin
override lazy val buildSettings: Seq[Setting[_]] = Def.settings(
develocityConfiguration := {
val isInsideCI = insideCI.value
val original = develocityConfiguration.value
val apacheDevelocityConfiguration =
original
.withProjectId(PekkoProjectId)
.withServer(
original.server
.withUrl(Some(ApacheDevelocityUrl))
.withAllowUntrusted(false))
.withBuildScan(
original.buildScan
.withPublishing(Publishing.onlyIf(_.authenticated))
.withBackgroundUpload(!isInsideCI)
.withObfuscation(
original.buildScan.obfuscation
.withIpAddresses(_.map(_ => ObfuscatedIPv4Address))))
if (isInsideCI) {
apacheDevelocityConfiguration
.withTestRetryConfiguration(
original.testRetryConfiguration
.withMaxRetries(1)
.withFlakyTestPolicy(FlakyTestPolicy.Fail) // preserve the original build outcome in case of flaky tests
)
} else apacheDevelocityConfiguration
})
}

View file

@ -32,3 +32,5 @@ addSbtPlugin("com.github.sbt" % "sbt-license-report" % "1.6.1")
addSbtPlugin("io.github.roiocam" % "sbt-depend-walker" % "0.1.1")
addSbtPlugin("org.apache.pekko" % "pekko-sbt-paradox" % "1.0.1")
addSbtPlugin("com.gradle" % "sbt-develocity" % "1.0.1")