-
Notifications
You must be signed in to change notification settings - Fork 1.2k
260 lines (247 loc) · 10.4 KB
/
Copy pathscoverage.yaml
File metadata and controls
260 lines (247 loc) · 10.4 KB
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: Scoverage
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * *' # Every day at 3 AM
push:
tags:
- '*'
pull_request:
branches:
- main
permissions:
contents: read
# This workflow compiles a subset of the Scala 3 projects with
# scoverage enabled to test robustness of scoverage.
#
# Triggers:
# - Nightly at 3 AM
# - Push to tags
# - PRs to main run the coverage test suite; [test_coverage] also compiles subprojects
# - Manual workflow dispatch
#
# Project scoverage compilation status:
#
# Compiles with scoverage + Ycheck:
# - tasty-core-bootstrapped
# - scala3-repl
# - scala3-presentation-compiler
# - scala3-language-server
# - scala3-staging
# - scala3-tasty-inspector
# - scala3-sbt-bridge-bootstrapped
#
# Compiles with scoverage (no Ycheck, -Werror disabled):
# - scala3-compiler-nonbootstrapped
# - scaladoc
#
# Coverage test suite:
# - scala3-bootstrapped (testCompilation --enable-coverage-phase)
#
# Does not compile with scoverage (omitted):
# - scala-library-bootstrapped
jobs:
# Projects that compile with coverage + Ycheck
tasty-core-bootstrapped-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `tasty-core-bootstrapped` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "tasty/target/tasty-core-bootstrapped/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
tasty-core-bootstrapped/clean;
tasty-core-bootstrapped/compile'
scala3-repl-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-repl` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "repl/target/scala3-repl/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-repl/clean;
scala3-repl/compile'
scala3-presentation-compiler-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-presentation-compiler` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "presentation-compiler/target/scala3-presentation-compiler/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-presentation-compiler/clean;
scala3-presentation-compiler/compile'
scala3-language-server-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-language-server` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "language-server/target/scala3-language-server/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-language-server/clean;
scala3-language-server/compile'
scala3-staging-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-staging` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "staging/target/scala3-staging/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-staging/clean;
scala3-staging/compile'
scala3-tasty-inspector-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-tasty-inspector` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "tasty-inspector/target/scala3-tasty-inspector/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-tasty-inspector/clean;
scala3-tasty-inspector/compile'
scala3-sbt-bridge-bootstrapped-coverage-ycheck:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage and Ycheck
run: |
./project/scripts/sbt '
set `scala3-sbt-bridge-bootstrapped` / Compile / compile / scalacOptions ++= Seq(
"-Ycheck:instrumentCoverage",
"-coverage-out", "sbt-bridge/target/scala3-sbt-bridge-bootstrapped/coverage-ycheck",
"-sourceroot", "${{ github.workspace }}"
);
scala3-sbt-bridge-bootstrapped/clean;
scala3-sbt-bridge-bootstrapped/compile'
# Projects that compile with coverage but without Ycheck
scala3-compiler-nonbootstrapped-coverage:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage
run: |
./project/scripts/sbt '
set `scala3-compiler-nonbootstrapped` / Compile / compile / scalacOptions ~= (_.filterNot(_ == "-Werror"));
set `scala3-compiler-nonbootstrapped` / Compile / compile / scalacOptions ++= Seq(
"-coverage-out", "compiler/target/scala3-compiler-nonbootstrapped/coverage",
"-sourceroot", "${{ github.workspace }}"
);
scala3-compiler-nonbootstrapped/clean;
scala3-compiler-nonbootstrapped/compile'
scaladoc-coverage:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.body, '[test_coverage]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Compile with coverage
run: |
./project/scripts/sbt '
set scaladoc / Compile / compile / scalacOptions ~= (_.filterNot(_ == "-Werror"));
set scaladoc / Compile / compile / scalacOptions ++= Seq(
"-coverage-out", "scaladoc/target/scaladoc-coverage",
"-sourceroot", "${{ github.workspace }}"
);
scaladoc/clean;
scaladoc/compile'
# Coverage test suite
scala3-bootstrapped-compilation-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Run coverage compilation tests
run: ./project/scripts/sbt 'scala3-bootstrapped/testCompilation --enable-coverage-phase'