-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
214 lines (207 loc) · 7.44 KB
/
main.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: CI
on:
push:
branches:
- main
- 'releases/*'
pull_request:
branches:
- '*'
env:
ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }}
ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }}
jobs:
linux:
name: 'Linux'
runs-on: ubuntu-latest
container: junitteam/build:latest
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
/root/.gradle/caches/
/root/.gradle/wrapper/dists
key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
test-${{ runner.os }}-gradle-
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: /root/.m2/repository
key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
test-${{ runner.os }}-maven-
- name: Prepare Gradle Enterprise credentials
run: |
mkdir -p /root/.gradle/enterprise/
echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties
- name: 'Test'
run: |
./gradlew --version
./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build
windows:
name: 'Windows'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/dists
key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
test-${{ runner.os }}-gradle-
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
test-${{ runner.os }}-maven-
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: Prepare Gradle Enterprise credentials
shell: bash
run: |
mkdir -p $HOME/.gradle/enterprise/
echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties
- name: 'Test'
shell: bash
run: |
./gradlew --version
./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build
./gradlew --stop
mac:
name: 'Mac OS'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/dists
key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
test-${{ runner.os }}-gradle-
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
test-${{ runner.os }}-maven-
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: Prepare Gradle Enterprise credentials
run: |
mkdir -p $HOME/.gradle/enterprise/
echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties
- name: 'Test'
run: |
./gradlew --version
./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build
coverage:
name: 'Coverage'
needs: linux
runs-on: ubuntu-latest
container: junitteam/build:latest
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
/root/.gradle/caches/
/root/.gradle/wrapper/dists
key: coverage-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
coverage-${{ runner.os }}-gradle-
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: /root/.m2/repository
key: coverage-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
coverage-${{ runner.os }}-maven-
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: Prepare Gradle Enterprise credentials
run: |
mkdir -p /root/.gradle/enterprise/
echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties
- name: 'Run tests with JaCoCo'
shell: bash
run: |
./gradlew --version
./gradlew --scan --no-parallel --stacktrace --warning-mode=all -PenableJaCoCo build jacocoRootReport
- name: Upload to Codecov.io
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bash <(curl -s https://codecov.io/bash)
publish_artifacts:
name: Publish Snapshot Artifacts
needs: linux
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/dists
key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
assemble-${{ runner.os }}-gradle-
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: 'Publish'
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: ./gradlew --scan publish -x check
update_documentation:
name: Update Snapshot Documentation
needs: linux
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache Gradle wrapper and dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/dists
key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }}
restore-keys: |
assemble-${{ runner.os }}-gradle-
- name: 'Set up JDK 11'
uses: actions/setup-java@v1
with:
java-version: 11
- name: 'Upload Documentation'
env:
GRGIT_USER: ${{ secrets.GH_TOKEN }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
run: |
sudo apt-get install graphviz
./src/publishDocumentationSnapshotOnlyIfNecessary.sh