-
Notifications
You must be signed in to change notification settings - Fork 33
64 lines (62 loc) · 2.86 KB
/
maven-data-capturing-samples-verification.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Verify Maven Data Capturing Samples
on:
push:
branches: [ main ]
paths: [ 'build-data-capturing-maven-samples/**', '.github/workflows/**' ]
pull_request:
branches: [ main ]
paths: [ 'build-data-capturing-maven-samples/**', '.github/workflows/**' ]
workflow_dispatch:
jobs:
verification:
name: Verification of ${{ matrix.name }}
runs-on: ubuntu-latest
env:
LOG_MSG_EXTENSION_LOADED: "Build operation 'Develocity mojo execution' completed"
LOG_MSG_EXECUTION_FAILED: "Error executing a DevelocityListener callback"
strategy:
matrix:
include:
- name: 'Develocity Maven extension version'
sample-file: 'capture-develocity-extension-version/maven-develocity-extension-version.groovy'
- name: 'OS processes'
sample-file: 'capture-os-processes/maven-os-processes.groovy'
- name: 'Processor arch'
sample-file: 'capture-processor-arch/maven-processor-arch.groovy'
- name: 'Profiles'
sample-file: 'capture-profiles/maven-profiles.groovy'
- name: 'Quality checks'
sample-file: 'capture-quality-check-issues/maven-quality-check-issues.groovy'
- name: 'Thermal throttling'
sample-file: 'capture-thermal-throttling/maven-thermal-throttling.groovy'
- name: 'Top-level project'
sample-file: 'capture-top-level-project/maven-top-level-project.groovy'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Provide data capture script to Maven build
run: |
# copy over sample script such that it gets pulled in by the Develocity extension
cp build-data-capturing-maven-samples/${{ matrix.sample-file }} common-develocity-maven-configuration/.mvn/develocity-custom-user-data.groovy
- name: Run Maven build
id: mvn-build
run: |
delimiter="$(openssl rand -hex 8)"
echo "mavenOutput<<${delimiter}" >> $GITHUB_OUTPUT
echo "$(mvn -f common-develocity-maven-configuration/pom.xml -Ddevelocity.url=https://ge.solutions-team.gradle.com -X -B clean validate)" >> $GITHUB_OUTPUT
echo "${delimiter}" >> $GITHUB_OUTPUT
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
- name: Validate extension loaded
# Asserting that extension was loaded checking a log entry
run: exit 1
if: ${{ !contains(steps.mvn-build.outputs.mavenOutput, env.LOG_MSG_EXTENSION_LOADED) }}
- name: Validate extension executed
# Asserting that extension was run successfully checking absence of an error log entry
run: exit 1
if: contains(steps.mvn-build.outputs.mavenOutput, env.LOG_MSG_EXECUTION_FAILED)