-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
235 lines (216 loc) · 8.88 KB
/
build-test.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Check
on:
pull_request: # Check Pull Requests
push:
branches:
- main # Check main branch after merge
schedule:
- cron: "0 4 * * *" # Nightly build (@daily)
concurrency:
# Only run once for latest commit per ref and cancel other (previous) runs.
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
extra-vars:
name: Extra variables
runs-on: ubuntu-20.04
outputs:
akka_version_opts: ${{ steps.akka-snapshots.outputs.akka_opts }}
akka_http_version_opts: ${{ steps.akka-snapshots.outputs.akka_http_opts }}
steps:
- id: akka-snapshots
run: |
if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then
AKKA_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -oEi '2\.6\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1)
AKKA_HTTP_VERSION=$(curl -s https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-http-core_2.13/ | grep -oEi '10\.1\.[0-9]+\+[RCM0-9]+-[0-9a-f]{8}-SNAPSHOT' | sort -V | tail -n 1)
echo "::set-output name=akka_opts::-Dakka.version=$AKKA_VERSION"
echo "::set-output name=akka_http_opts::-Dakka.http.version=$AKKA_HTTP_VERSION"
else
echo "::set-output name=akka_opts::"
echo "::set-output name=akka_http_opts::"
fi
prefetch-for-caching:
name: Prefetch dependencies and JVMs for caching
uses: playframework/.github/.github/workflows/sbt.yml@v1
# if: steps.coursier-cache.outputs.cache-hit-coursier != 'true' # Waiting for https://github.com/coursier/cache-action/pull/296
with:
cmd: |
sbt +update # Runs with adoptium:8 (default)
# sbt --sbt-version 1.6.2 +update # If we run scripted tests with multiple sbt versions, we could init that sbt installs here
sbt +mimaPreviousClassfiles # Fetches previous artifacts
cd documentation && sbt +update && cd .. # Fetches dependencies of the documentation project
sbt -java-home `cs java-home --jvm adoptium:11` exit # Init sbt with new JVM that will be downloaded
sbt -java-home `cs java-home --jvm adoptium:17` exit # Init sbt with new JVM that will be downloaded
check-code-style:
name: Code Style # scalafmt, javafmt, file headers, akka version check
needs:
- "extra-vars"
- "prefetch-for-caching"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" validateCode
check-binary-compatibility:
name: Binary Compatibility
needs: "prefetch-for-caching"
uses: playframework/.github/.github/workflows/binary-check.yml@v1
check-code-style-docs:
name: Code Style Docs
needs: "prefetch-for-caching"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
cmd: |
cd documentation
sbt validateCode
publish-local-jdk8:
name: Publish Local
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
java: 8
cmd: |
rm -rf ~/.ivy2/local
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" crossScalaVersions crossSbtVersions +publishLocal
cache-path: ~/.ivy2/local/com.typesafe.play
cache-key: play-published-local-jdk8-${{ github.sha }}
publish-local-jdk11:
name: Publish Local
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
java: 11
cmd: |
rm -rf ~/.ivy2/local
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" crossScalaVersions crossSbtVersions +publishLocal
cache-path: ~/.ivy2/local/com.typesafe.play
cache-key: play-published-local-jdk11-${{ github.sha }}
check-microbenchmarks:
name: Microbenchmarks
if: github.event_name == 'schedule' # Very slowly, only for nightly-build
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
# Don't build first, let sbt automatically build any dependencies that are needed when we run the microbenchmarks.
# This should be quicker than doing an explicit publish step.
# Just run single iteration of microbenchmark to test that they run properly.
# The results will be inaccurate, but this ensures that the microbenchmarks at least compile and run.
# foe = FailOnError http://mail.openjdk.java.net/pipermail/jmh-dev/2015-February/001685.html
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true"
tests:
name: Tests
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
java: 11
scala: 2.13.8
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$SCALA_VERSION test
it-tests:
name: Integration Tests
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
java: 11
scala: 2.13.8
cmd: sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$SCALA_VERSION Play-Integration-Test/It/test
docs-tests:
name: Docs Tests
needs:
- "extra-vars"
- "check-code-style"
- "check-binary-compatibility"
- "check-code-style-docs"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
java: 11
scala: 2.13.8
cmd: cd documentation && sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" ++$SCALA_VERSION test
scripted-tests-1:
name: Scripted Tests (1 of 3)
needs:
- "extra-vars"
- "publish-local-jdk8"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
scala: 2.13.8
env: SBT_VERSION=1.6.2
cmd: >-
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" "
project Sbt-Plugin;
set scriptedSbt := \"$SBT_VERSION\";
set scriptedLaunchOpts += \"-Dscala.version=$SCALA_VERSION\";
show scriptedSbt;
show scriptedLaunchOpts;
scripted play-sbt-plugin/*1of3
"
cache-path: ~/.ivy2/local/com.typesafe.play
cache-key: play-published-local-jdk8-${{ github.sha }}
scripted-tests-2:
name: Scripted Tests (2 of 3)
needs:
- "extra-vars"
- "publish-local-jdk8"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
scala: 2.13.8
env: SBT_VERSION=1.6.2
cmd: >-
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" "
project Sbt-Plugin;
set scriptedSbt := \"$SBT_VERSION\";
set scriptedLaunchOpts += \"-Dscala.version=$SCALA_VERSION\";
show scriptedSbt;
show scriptedLaunchOpts;
scripted play-sbt-plugin/*2of3
"
cache-path: ~/.ivy2/local/com.typesafe.play
cache-key: play-published-local-jdk8-${{ github.sha }}
scripted-tests-3:
name: Scripted Tests (3 of 3)
needs:
- "extra-vars"
- "publish-local-jdk8"
uses: playframework/.github/.github/workflows/sbt.yml@v1
with:
scala: 2.13.8
env: SBT_VERSION=1.6.2
cmd: >-
sbt "${{needs.extra-vars.outputs.akka_version_opts}}" "${{needs.extra-vars.outputs.akka_http_version_opts}}" "
project Sbt-Plugin;
set scriptedSbt := \"$SBT_VERSION\";
set scriptedLaunchOpts += \"-Dscala.version=$SCALA_VERSION\";
show scriptedSbt;
show scriptedLaunchOpts;
scripted play-sbt-plugin/*3of3
"
cache-path: ~/.ivy2/local/com.typesafe.play
cache-key: play-published-local-jdk8-${{ github.sha }}
finish:
name: Finish
if: github.event_name == 'pull_request'
needs: # Should be last
- "tests"
- "it-tests"
- "docs-tests"
- "scripted-tests-1"
- "scripted-tests-2"
- "scripted-tests-3"
uses: playframework/.github/.github/workflows/rtm.yml@v1