File tree 5 files changed +91
-30
lines changed
5 files changed +91
-30
lines changed Original file line number Diff line number Diff line change 1
1
name : CI
2
2
3
- on : [push, pull_request]
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ pull_request :
8
+ branches :
9
+ - master
4
10
5
11
jobs :
6
12
build :
7
13
name : Build on Jenkins ${{ matrix.jenkins-version }}, JDK ${{ matrix.java }} and ${{ matrix.os }}
8
14
runs-on : ${{ matrix.os }}
9
15
strategy :
10
16
matrix :
11
- java : [1. 8, 11]
17
+ java : [8, 11]
12
18
jenkins-version : [2.60.3, 2.176.3]
13
19
os : [ubuntu-latest, windows-latest]
14
20
include :
@@ -19,11 +25,34 @@ jobs:
19
25
jenkins-version : ' 2.60.3'
20
26
21
27
steps :
28
+
22
29
- uses : actions/checkout@v1
30
+
23
31
- name : Set up JDK ${{ matrix.java }}
24
32
uses : actions/setup-java@v1
25
33
with :
26
34
java-version : ${{ matrix.java }}
35
+
36
+ - name : Cache dependencies
37
+ uses : actions/cache@v1
38
+ with :
39
+ path : ~/.m2/repository
40
+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
41
+ restore-keys : |
42
+ ${{ runner.os }}-maven
43
+
27
44
- name : Build with Maven
45
+ run : mvn -Pjacoco clean verify -B -V --no-transfer-progress ${{ matrix.flags }}
46
+
47
+ - name : Report coverage
48
+ shell : bash
49
+ env :
50
+ CODACY_PROJECT_TOKEN : ${{ secrets.CODACY_PROJECT_TOKEN }}
51
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
28
52
run : |
29
- mvn install -B -V --no-transfer-progress ${{ matrix.flags }}
53
+ if [ "$CODACY_PROJECT_TOKEN" != "" ] && [ "$CODECOV_TOKEN" != "" ]; then
54
+ bash <(curl -s https://codecov.io/bash) -f "*jacoco.xml"
55
+ bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Java -r integrations/target/site/jacoco-aggregate/jacoco.xml
56
+ else
57
+ echo "No secrets provided for coverage report"
58
+ fi
Original file line number Diff line number Diff line change 1
1
language : java
2
2
3
- dist : xenial
3
+ dist : bionic
4
4
5
5
if : |
6
6
repo != jenkinsci/configuration-as-code-plugin OR \
@@ -10,41 +10,22 @@ if: |
10
10
services :
11
11
- docker
12
12
13
- before_cache :
14
- - rm -rf $HOME/.m2/repository/io/jenkins/configuration-as-code*
15
-
16
13
cache :
17
14
directories :
18
15
- $HOME/.m2
19
16
20
- env :
21
- global :
22
- - JAVA_LEVEL=8
23
-
24
- matrix :
25
- include :
26
- - jdk : openjdk11
27
- env :
28
- - MVN_FLAG='-Djenkins.version=2.176.3 -Daccess-modifier-checker.failOnError=true'
29
- - jdk : openjdk8
30
- env :
31
- - MVN_FLAG='-Djenkins.version=2.176.3 -Daccess-modifier-checker.failOnError=true'
32
- - jdk : openjdk8
17
+ jdk : openjdk11
33
18
34
- install :
35
- - mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -B -V $MVN_FLAG -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
19
+ install : skip
36
20
37
21
script :
38
22
- |
39
- mvn -Penable-jacoco clean install jacoco:report -B \
40
- -Djava.level=$JAVA_LEVEL \
41
- $MVN_FLAG -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli. transfer.Slf4jMavenTransferListener=warn
23
+ mvn -Pjacoco clean verify -B -V \
24
+ -Djenkins.version=2.176.3 -Daccess-modifier-checker.failOnError=true \
25
+ --no- transfer-progress
42
26
43
27
after_success :
44
- - export LATEST_VERSION="$(curl -Ls https://api.bintray.com/packages/codacy/Binaries/codacy-coverage-reporter/versions/_latest | jq -r .name)"
45
- - curl -Ls -o codacy-coverage-reporter "https://dl.bintray.com/codacy/Binaries/$LATEST_VERSION/codacy-coverage-reporter-linux"
46
- - chmod +x codacy-coverage-reporter
47
- - ./codacy-coverage-reporter report -l Java -r plugin/target/site/jacoco/jacoco.xml
28
+ - bash <(curl -s https://codecov.io/bash) -f "*jacoco.xml"
48
29
49
30
notifications :
50
31
email : false
Original file line number Diff line number Diff line change
1
+ comment :
2
+ layout : " header, diff, tree, changes"
Original file line number Diff line number Diff line change 677
677
</resource >
678
678
</resources >
679
679
</build >
680
+
681
+ <profiles >
682
+ <profile >
683
+ <id >jacoco</id >
684
+ <build >
685
+ <plugins >
686
+ <plugin >
687
+ <groupId >org.jacoco</groupId >
688
+ <artifactId >jacoco-maven-plugin</artifactId >
689
+ <executions >
690
+ <execution >
691
+ <id >report-aggregate</id >
692
+ <phase >verify</phase >
693
+ <goals >
694
+ <goal >report-aggregate</goal >
695
+ </goals >
696
+ </execution >
697
+ </executions >
698
+ </plugin >
699
+ </plugins >
700
+ </build >
701
+ </profile >
702
+ </profiles >
680
703
</project >
Original file line number Diff line number Diff line change 15
15
<modules >
16
16
<module >snakeyaml</module >
17
17
<module >plugin</module >
18
- <module >integrations</module >
19
18
<module >test-harness</module >
19
+ <module >integrations</module >
20
20
</modules >
21
21
22
22
<properties >
99
99
</plugins >
100
100
</build >
101
101
102
+ <profiles >
103
+ <profile >
104
+ <id >jacoco</id >
105
+ <build >
106
+ <plugins >
107
+ <plugin >
108
+ <groupId >org.jacoco</groupId >
109
+ <artifactId >jacoco-maven-plugin</artifactId >
110
+ <executions >
111
+ <execution >
112
+ <goals >
113
+ <goal >prepare-agent</goal >
114
+ </goals >
115
+ </execution >
116
+ </executions >
117
+ <configuration >
118
+ <excludes >
119
+ <exclude >**/Messages.class</exclude >
120
+ </excludes >
121
+ </configuration >
122
+ </plugin >
123
+ </plugins >
124
+ </build >
125
+ </profile >
126
+ </profiles >
127
+
102
128
</project >
You can’t perform that action at this time.
0 commit comments