Skip to content

Commit

Permalink
Merge pull request quarkusio#36473 from gsmet/build-scan-for-prs
Browse files Browse the repository at this point in the history
Enable publication of build scans for PRs coming from forks
  • Loading branch information
gsmet authored Nov 8, 2023
2 parents e863473 + d501eee commit 75cdefb
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/develocity-preapproved-developers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"preapproved-developers": [
"alesj",
"aloubyansky",
"aureamunoz",
"brunobat",
"cescoffier",
"DavideD",
"dmlloyd",
"ebullient",
"emmanuelbernard",
"evanchooly",
"FroMage",
"galderz",
"gastaldi",
"geoand",
"gsmet",
"gwenneg",
"holly-cummins",
"ia3andy",
"iocanel",
"jmartisk",
"johnaohara",
"jponge",
"karesti",
"Karm",
"Ladicek",
"machi1990",
"manovotn",
"manusa",
"maxandersen",
"metacosm",
"MichalMaler",
"michalvavrik",
"michelle-purcell",
"MikeEdgar",
"mkouba",
"n1hility",
"ozangunalp",
"patriot1burke",
"pedroigor",
"phillip-kruger",
"ppalaga",
"radcortez",
"rsvoboda",
"Sanne",
"sberyozkin",
"Sgitario",
"stalep",
"starksm64",
"stuartwdouglas",
"tsegismont",
"yrodiere",
"zakkak"
]
}
58 changes: 56 additions & 2 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Initial JDK 11 Build"

calculate-test-jobs:
name: Calculate Test Jobs
Expand Down Expand Up @@ -388,6 +393,11 @@ jobs:
path: |
**/build.log
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "JVM Tests - JDK ${{matrix.java.name}}"

maven-tests:
name: Maven Tests - JDK ${{matrix.java.name}}
Expand Down Expand Up @@ -445,7 +455,6 @@ jobs:
distribution: temurin
java-version: ${{ matrix.java.java-version }}
- name: Build

# Important: keep -pl ... in sync with "Calculate run flags"!
# Despite the pre-calculated run_jvm flag, GIB has to be re-run here to figure out the exact submodules to build.
run: ./mvnw $COMMON_MAVEN_ARGS $JVM_TEST_MAVEN_ARGS clean install -pl 'integration-tests/maven' -pl 'integration-tests/devmode' ${{ needs.build-jdk11.outputs.gib_args }}
Expand Down Expand Up @@ -477,6 +486,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Maven Tests - JDK ${{matrix.java.name}}"

gradle-tests:
name: Gradle Tests - JDK ${{matrix.java.name}}
Expand Down Expand Up @@ -549,6 +563,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Gradle Tests - JDK ${{matrix.java.name}}"

devtools-tests:
name: Devtools Tests - JDK ${{matrix.java.name}}
Expand Down Expand Up @@ -627,6 +646,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Devtools Tests - JDK ${{matrix.java.name}}"

kubernetes-tests:
name: Kubernetes Tests - JDK ${{matrix.java.name}}
Expand Down Expand Up @@ -655,6 +679,10 @@ jobs:
os-name: "windows-latest"
}
steps:
- name: Gradle Enterprise environment
run: |
echo "GE_TAGS=jdk-${{matrix.java.name}}" >> "$GITHUB_ENV"
echo "GE_CUSTOM_VALUES=gh-job-name=Kubernetes Tests - JDK ${{matrix.java.name}}" >> "$GITHUB_ENV"
- name: Support longpaths on Windows
if: "startsWith(matrix.java.os-name, 'windows')"
run: git config --global core.longpaths true
Expand Down Expand Up @@ -700,6 +728,11 @@ jobs:
target/build-report.json
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Kubernetes Tests - JDK ${{matrix.java.name}}"

quickstarts-tests:
name: Quickstarts Compilation - JDK ${{matrix.java.name}}
Expand Down Expand Up @@ -756,6 +789,12 @@ jobs:
quarkus-quickstarts/target/build-report.json
quarkus-quickstarts/LICENSE
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Quickstarts Compilation - JDK ${{matrix.java.name}}"

virtual-thread-native-tests:
name: Native Tests - Virtual Thread - ${{matrix.category}}
runs-on: ${{matrix.os-name}}
Expand Down Expand Up @@ -812,14 +851,19 @@ jobs:
integration-tests/virtual-threads/target/build-report.json
integration-tests/virtual-threads/target/gradle-build-scan-url.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Native Tests - Virtual Thread - ${{matrix.category}}"

tcks-test:
name: MicroProfile TCKs Tests
needs: [build-jdk11, calculate-test-jobs]
# Skip main in forks
if: "needs.calculate-test-jobs.outputs.run_tcks == 'true' && (github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main'))"
runs-on: ubuntu-latest
timeout-minutes: 150

steps:
- name: Gradle Enterprise environment
run: |
Expand Down Expand Up @@ -879,6 +923,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "MicroProfile TCKs Tests"

native-tests:
name: Native Tests - ${{matrix.category}}
Expand Down Expand Up @@ -971,6 +1020,11 @@ jobs:
target/gradle-build-scan-url.txt
LICENSE.txt
retention-days: 2
- name: Save Build Scan
if: always()
uses: gradle/github-actions/maven-build-scan/save@v1-beta
with:
job-name: "Native Tests - ${{matrix.category}}"

build-report:
runs-on: ubuntu-latest
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/develocity-publish-build-scans.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Develocity - Publish Maven Build Scans

on:
workflow_run:
workflows: [ "Quarkus CI" ]
types: [ completed ]

defaults:
run:
shell: bash

jobs:
publish-build-scans:
if: github.repository == 'quarkusio/quarkus' && github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Extract preapproved developers list
id: extract-preapproved-developers
run: |
preapproveddevelopers=$(cat .github/develocity-preapproved-developers.json)
echo "preapproved-developpers=${preapproveddevelopers}" >> $GITHUB_OUTPUT
- name: Publish Maven Build Scans
uses: gradle/github-actions/maven-build-scan/publish@v1-beta
if: ${{ contains(fromJson(steps.extract-preapproved-developers.outputs.preapproved-developpers).preapproved-developers, github.event.workflow_run.actor.login) }}
with:
develocity-url: 'https://ge.quarkus.io'
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
skip-comment: true
- name: Push to summary
run: |
echo -n "Pull request: " >> ${GITHUB_STEP_SUMMARY}
cat pr-number.out >> ${GITHUB_STEP_SUMMARY}
echo >> ${GITHUB_STEP_SUMMARY}
echo >> ${GITHUB_STEP_SUMMARY}
echo "| Job | Status | Build scan |" >> ${GITHUB_STEP_SUMMARY}
echo "|---|---|---|" >> ${GITHUB_STEP_SUMMARY}
cat publication.out >> ${GITHUB_STEP_SUMMARY}

0 comments on commit 75cdefb

Please sign in to comment.