-
Notifications
You must be signed in to change notification settings - Fork 1
121 lines (115 loc) · 4.48 KB
/
java-gradle-base.yaml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Java Gradle Base
# Reusable workflow for building testing and assessing code quality
on:
workflow_call:
inputs:
download-lfs-files:
description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)"
required: false
type: boolean
default: false
gradle-cache:
description: "Whether Gradle caching is enabled or not. (Default is true)"
required: false
type: boolean
default: true
gradle-cache-read-only:
description: "Whether Gradle caching should be read-only. Only used for build and test jobs. (Default is false)"
required: false
type: boolean
default: false
gradle-refresh-dependencies:
description: "Whether Gradle should refresh dependencies. (Default is false)"
required: false
type: boolean
default: false
gradle-version:
description: "Gradle version to be installed. (Default is wrapper)"
required: false
type: string
default: "wrapper"
java-distribution:
description: "Java distribution to be installed. (Default is microsoft)"
required: false
type: string
default: "microsoft"
java-version:
description: "Java version to be installed. (Default is 11)"
required: false
type: string
default: "11"
working-directory:
description: "Working directory of your Gradle artifacts. (Default is .)"
required: false
type: string
default: "."
secrets:
signing-key-id:
description: "Key id for signing the Sonatype publication."
required: true
signing-password:
description: "Password for signing the Sonatype publication."
required: true
signing-secret-key-ring:
description: "Key ring (base64 encoded) for signing the Sonatype publication."
required: true
sonar-organization:
description: "Organization for Sonarcloud"
required: true
sonar-token:
description: "Token for Sonarcloud."
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-java-gradle-base
cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch }}
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Build
uses: bakdata/ci-templates/actions/[email protected]
with:
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
gradle-version: ${{ inputs.gradle-version }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
working-directory: ${{ inputs.working-directory }}
test:
name: Test
runs-on: ubuntu-22.04
needs: build
steps:
- name: Run unit tests
uses: bakdata/ci-templates/actions/[email protected]
with:
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: ${{ inputs.gradle-cache-read-only }}
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
gradle-version: ${{ inputs.gradle-version }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
working-directory: ${{ inputs.working-directory }}
assess-code-quality:
name: Asses code quality
runs-on: ubuntu-22.04
needs: test
steps:
- name: Assess code quality
uses: bakdata/ci-templates/actions/[email protected]
with:
download-lfs-files: ${{ inputs.download-lfs-files }}
gradle-cache: ${{ inputs.gradle-cache }}
gradle-cache-read-only: true
gradle-refresh-dependencies: ${{ inputs.gradle-refresh-dependencies }}
gradle-version: ${{ inputs.gradle-version }}
java-distribution: ${{ inputs.java-distribution }}
java-version: ${{ inputs.java-version }}
signing-key-id: ${{ secrets.signing-key-id }}
signing-password: ${{ secrets.signing-password }}
signing-secret-key-ring: ${{ secrets.signing-secret-key-ring }}
sonar-organization: ${{ secrets.sonar-organization }}
sonar-token: ${{ secrets.sonar-token }}
working-directory: ${{ inputs.working-directory }}