Skip to content

Commit

Permalink
Capture build scans on ge.apache.org to benefit from deep build insig…
Browse files Browse the repository at this point in the history
…hts (#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 ff556b9.

* Improve variable name

* Use upper case i in CI abbreviation
  • Loading branch information
c00ler committed Apr 25, 2024
1 parent 7deed41 commit 763cdb6
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/binary-compatibility-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build-test-prValidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/generate-doc-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions .github/workflows/headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/link-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/nightly-1.0-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly-builds-aeron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/nightly-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-1.0-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-1.0-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scala3-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scala3-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
2 changes: 2 additions & 0 deletions .github/workflows/timing-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
65 changes: 65 additions & 0 deletions project/PekkoDevelocityPlugin.scala
Original file line number Diff line number Diff line change
@@ -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
})
}
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 763cdb6

Please sign in to comment.