-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.45 KB
/
code-climate-test-coverage.yaml
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
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
spring-boot:
name: Build, Run Test and upload test coverage to code climate
runs-on: ubuntu-latest
steps:
# Checkout Project
- name: Checkout File Submission Repository
uses: actions/checkout@v2
# Setup Java Environment
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
# Cache maven dependencies
- name: Cache Java Dependencies
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Update Env Variables
- name: Update Env Variables
run: |
echo "CC_TEST_REPORTER_ID=e103c74e2b53c51672067da3861f3e6aa412cec1a8819e60dd93bce66c18bed0" >> $GITHUB_ENV
echo "JACOCO_SOURCE_PATH=${{github.workspace}}/src/document-utils-api/src/main/java" >> $GITHUB_ENV
#P Push coverage to code climate
- name: Test & publish code coverage
uses: paambaati/[email protected]
with:
# The report file must be there, otherwise Code Climate won't find it
coverageCommand: mvn -B verify -P all --file src/pom.xml
coverageLocations: ${{github.workspace}}/src/document-utils-api/target/site/jacoco/jacoco.xml:jacoco