-
-
Notifications
You must be signed in to change notification settings - Fork 58
180 lines (160 loc) · 5.58 KB
/
mgmt-build.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: CAS
env:
JAVA_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server -XX:+UseG1GC"
GRADLE_OPTS: "-Xms512m -Xmx6048m -Xss128m -XX:ReservedCodeCacheSize=512m -server -XX:+UseG1GC"
TERM: xterm-256color
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
GH_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JDK_DISTRIBUTION: "corretto"
JDK_CURRENT: 21
DOCS_BRANCH: 7.0.x
##########################################################################
on:
push:
branches: [ 7.0.x ]
pull_request:
branches: [ 7.0.x ]
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'apereo/cas-management' }}
##########################################################################
jobs:
initialize:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Initialize
run: ls ./ci && chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
##########################################################################
cache:
runs-on: macos-latest
needs: [initialize]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: ls ./ci && chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- uses: actions/checkout@v4
- name: Download Dependencies
run: ./ci/download-dependencies.sh
##########################################################################
build:
needs: [cache]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
shell: bash
- name: Build with Gradle
run: ./ci/build.sh
##########################################################################
static-analysis:
runs-on: macos-latest
needs: [build]
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- name: Run Static Analysis
run: ./ci/analyze-style.sh
##########################################################################
validate-javadocs:
runs-on: macos-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- name: Validate Javadocs
run: ./ci/build-javadocs.sh
##########################################################################
publish-snapshots:
runs-on: macos-latest
needs: [cache]
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- name: Publish SNAPSHOTs
if: ${{ env.SONATYPE_USER != null && env.SONATYPE_PWD != null }}
run: ./ci/publish-snapshots-release.sh
##########################################################################
publish-docs:
runs-on: macos-latest
if: ${{ github.event_name == 'push' }}
needs: [cache]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- name: Publish Documentation
run: ./ci/push-docs-ghpages.sh ${DOCS_BRANCH}
##########################################################################
tests:
needs: [cache]
continue-on-error: false
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.JDK_DISTRIBUTION }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Initialize
run: chmod -R 777 ./ci/*.sh && ./ci/init-build.sh
- name: Run Tests
run: ./ci/tests/run-tests-simple.sh