-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.88 KB
/
jacoco_check.yml
File metadata and controls
75 lines (72 loc) · 2.88 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
#
# Copyright 2021 ABSA Group Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: JaCoCo report
on:
pull_request:
branches: [ master ]
types: [ opened, edited, synchronize, reopened ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.8"
- name: Build and run tests
run: sbt jacoco
- name: Add coverage to PR for scala 2.11 and spark 2.4
id: jacoco211
uses: madrapps/jacoco-report@v1.3
with:
paths: ${{ github.workspace }}/spark-commons/target/spark2.4-jvm-2.11/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
title: JaCoCo code coverage report - scala:2.11 - spark:2.4
update-comment: true
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco211.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco211.outputs.coverage-changed-files }}"
- name: Add coverage to PR for scala 2.12 and spark 3.3
id: jacoco212
uses: madrapps/jacoco-report@v1.3
with:
paths: ${{ github.workspace }}/spark-commons/target/spark3.3-jvm-2.12/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
title: JaCoCo code coverage report - scala:2.12 - spark:3.3
update-comment: true
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco212.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco212.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than 80%
if: ${{ steps.jacoco211.outputs.coverage-changed-files < 80.0 }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Changed files coverage is less than 80%!')
- name: Fail PR if changed files coverage is less than 80%
if: ${{ steps.jacoco212.outputs.coverage-changed-files < 80.0 }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Changed files coverage is less than 80%!')