blob: 60f5918cc0d6d00ae7f2d4aa5908b4356a98b8fb [file] [log] [blame]
Eric Ball8f404442026-01-05 21:31:56 -08001---
2# SPDX-License-Identifier: Apache-2.0
3# SPDX-FileCopyrightText: 2026 The Linux Foundation
4name: Gerrit Verify - Maven
5
6# yamllint disable-line rule:truthy
7on:
8 workflow_dispatch:
9 inputs:
10 # Gerrit-to-Github defaults
11 GERRIT_BRANCH:
12 description: "Branch that change is against"
13 required: true
14 type: string
15 GERRIT_CHANGE_ID:
16 description: "The ID for the change"
17 required: true
18 type: string
19 GERRIT_CHANGE_NUMBER:
20 description: "The Gerrit number"
21 required: true
22 type: string
23 GERRIT_CHANGE_URL:
24 description: "URL to the change"
25 required: true
26 type: string
27 GERRIT_EVENT_TYPE:
28 description: "Type of Gerrit event"
29 required: true
30 type: string
31 GERRIT_PATCHSET_NUMBER:
32 description: "The patch number for the change"
33 required: true
34 type: string
35 GERRIT_PATCHSET_REVISION:
36 description: "The revision sha"
37 required: true
38 type: string
39 GERRIT_PROJECT:
40 description: "Project in Gerrit"
41 required: true
42 type: string
43 GERRIT_REFSPEC:
44 description: "Gerrit refspec of change"
45 required: true
46 type: string
47 # Needed for maven-build-action
48 JDK_VERSION:
49 description: "OpenJDK version"
50 required: false
51 default: "17"
52 type: string
53 MVN_VERSION:
54 description: "Maven version"
55 required: false
56 default: "3.8.2"
Eric Ball51e27f42026-02-03 07:51:28 -080057 type: string
Eric Ball8f404442026-01-05 21:31:56 -080058 MVN_PARAMS:
59 description: "Maven parameters to pass to the mvn command"
60 required: false
61 default: ""
62 type: string
63 MVN_PHASES:
64 description: "Comma separated list of phases to execute"
65 required: false
66 default: "clean deploy"
67 type: string
68 MVN_OPTS:
69 description: "Maven options"
70 required: false
71 # yamllint disable rule:line-length
72 default: >-
73 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
74 -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
75 -DaltDeploymentRepository=staging::default::file:"${GITHUB_WORKSPACE}"/m2repo
76 # yamllint enable rule:line-length
77 type: string
78 MVN_POM_FILE:
79 description: "Path to pom.xml file."
80 required: false
81 default: "pom.xml"
82 type: string
83 MVN_PROFILES:
84 description: "Comma-delimited list of profiles to activate"
85 required: false
86 default: ""
87 type: string
88 MVN_GLOBAL_SETTINGS:
89 description: "Maven global settings configuration."
90 required: false
Eric Ball8f404442026-01-05 21:31:56 -080091 type: string
92 ENV_VARS:
93 # yamllint disable-line rule:line-length
94 description: "Pass GitHub variables to be exported as environment variables via `toJSON(vars)` or specific variables encoded in JSON format"
95 required: false
96 default: "{}"
97 type: string
98 ENV_SECRETS:
99 # yamllint disable-line rule:line-length
100 description: "Pass GitHub secrets to be exported as environment variables via `toJSON(secrets)` or specific secrets encoded in JSON format"
101 required: false
102 default: "{}"
103 type: string
104
105concurrency:
106 # yamllint disable-line rule:line-length
107 group: verify-maven-${{ github.workflow }}-${{ github.event.inputs.GERRIT_CHANGE_ID || github.run_id }}
108 cancel-in-progress: true
109
110jobs:
111 maven-verify:
112 runs-on: ubuntu-latest
113 steps:
114 # yamllint disable-line rule:line-length
115 - uses: lfreleng-actions/checkout-gerrit-change-action@54d751e8bd167bc91f7d665dabe33fae87aaaa63 # v0.9
116 with:
117 gerrit-refspec: ${{ inputs.GERRIT_REFSPEC }}
118 gerrit-project: ${{ inputs.GERRIT_PROJECT }}
119 gerrit-url: ${{ vars.GERRIT_URL }}
120 delay: "0s"
121 - name: Run Maven
122 # yamllint disable-line rule:line-length
123 uses: lfreleng-actions/maven-build-action@5be56aed8bed4f0bf9d699f2817eaef37c94ac02 # v0.2.0
124 with:
125 java-version: ${{ inputs.JDK_VERSION }}
126 mvn-version: ${{ inputs.MVN_VERSION }}
127 mvn-params: ${{ inputs.MVN_PARAMS }}
128 mvn-phases: ${{ inputs.MVN_PHASES }}
129 mvn-opts: ${{ inputs.MVN_OPTS }}
130 mvn-pom-file: ${{ inputs.MVN_POM_FILE }}
131 mvn-profiles: ${{ inputs.MVN_PROFILES }}
132 env-vars: ${{ inputs.ENV_VARS }}
133 env-secrets: ${{ inputs.ENV_SECRETS }}
134 global-settings: ${{ inputs.MVN_GLOBAL_SETTINGS }}