Skip to content

Commit bfaad48

Browse files
committed
update workflow and split it into pipelines
1 parent 48f2999 commit bfaad48

File tree

3 files changed

+36
-29
lines changed

3 files changed

+36
-29
lines changed

Diff for: .github/workflows/demo-workflow.yml

+35-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# This workflow will build a Java project with Maven
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
31

42
name: Java CI with Maven
53

@@ -10,42 +8,51 @@ on:
108
branches: [ master ]
119

1210
jobs:
13-
build:
1411

12+
compile:
1513
runs-on: ubuntu-latest
16-
14+
name: Running Java ${{ matrix.java }} compile
1715
steps:
1816
- uses: actions/checkout@v2
1917
- name: Set up JDK 1.8
2018
uses: actions/setup-java@v1
2119
with:
2220
java-version: 1.8
23-
2421
- name: Compile code
2522
run: mvn compile
2623

27-
- name: Run unit tests
28-
run: mvn test
29-
30-
- name: Build with Maven
31-
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
32-
33-
- name: generate report codecov
34-
run: mvn cobertura:cobertura
35-
36-
- name: generate report codecov
37-
run: mvn cobertura:cobertura
24+
test:
25+
runs-on: ubuntu-latest
26+
name: Running tests
27+
needs: compile
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: Set up JDK 1.8
31+
uses: actions/setup-java@v1
32+
with:
33+
java-version: 1.8
34+
- name: Run unit tests
35+
run: mvn test
3836

39-
- name: Upload coverage
40-
if: success()
41-
run: |
42-
curl -s https://codecov.io/bash | bash
43-
env:
44-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45-
shell: bash
37+
build:
38+
runs-on: ubuntu-latest
39+
name: Run mvn build and generate coverage report
40+
needs: compile
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: Set up JDK 1.8
44+
uses: actions/setup-java@v1
45+
with:
46+
java-version: 1.8
47+
- name: Build with Maven
48+
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
49+
- name: generate report codecov
50+
run: mvn cobertura:cobertura
51+
- name: Upload coverage
52+
if: success()
53+
run: |
54+
curl -s https://codecov.io/bash | bash
55+
env:
56+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
57+
shell: bash
4658

47-
- name: Upload Maven build artifact
48-
uses: actions/upload-artifact@v1
49-
with:
50-
name: artifact
51-
path: target/workflow-github-actions-1.0-SNAPSHOT.jar

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[![codecov](https://codecov.io/gh/kasdihacene/workflow-github-actions/branch/master/graph/badge.svg)](https://codecov.io/gh/kasdihacene/workflow-github-actions)

Diff for: pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
</configuration>
103103
</plugin>
104104

105-
106105
</plugins>
107106
</build>
108107

0 commit comments

Comments
 (0)