Skip to content

Commit c747564

Browse files
committed
add codecov
1 parent e19da4d commit c747564

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

.github/workflows/demo-workflow.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,35 @@ on:
1212
jobs:
1313
build:
1414

15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-latest windows-latest
1616

1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Set up JDK 1.8
2020
uses: actions/setup-java@v1
2121
with:
2222
java-version: 1.8
23+
24+
- name: Compile code
25+
run: mvn compile
26+
27+
- name: Run unit tests
28+
run: mvn test
29+
2330
- name: Build with Maven
24-
run: mvn -B package --file pom.xml
31+
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
32+
33+
- name: Upload coverage to Codecov
34+
- uses: codecov/codecov-action@v1
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
37+
file: ./coverage.xml # optional
38+
flags: unittests # optional
39+
name: codecov-umbrella # optional
40+
fail_ci_if_error: true # optional (default = false)
41+
42+
- name: Upload Maven build artifact
43+
uses: actions/upload-artifact@v1
44+
with:
45+
name: artifact
46+
path: workflow-github-actions/target/workflow-github-actions-1.0-SNAPSHOT.jar

pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@
7676
</dependencies>
7777
</plugin>
7878

79+
<plugin>
80+
<groupId>org.codehaus.mojo</groupId>
81+
<artifactId>cobertura-maven-plugin</artifactId>
82+
<version>2.7</version>
83+
<configuration>
84+
<formats>
85+
<format>html</format>
86+
<format>xml</format>
87+
</formats>
88+
<check />
89+
</configuration>
90+
</plugin>
91+
92+
7993
</plugins>
8094
</build>
8195

0 commit comments

Comments
 (0)