forked from danrodgar/IntroUnitTesting
-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (94 loc) · 4.44 KB
/
test.yml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout main brach from GitHub
uses: actions/checkout@v2
- name: Step 2 - Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Step 3.1.1 - Have GitHub Actions Build Maven calculatorExample Project
run: cd code/calculatorExample ; mvn -B package --file pom.xml
- name: Step 3.1.2 - Generate JaCoCo Badge calculatorExample Project
id: jacoco1
uses: cicirello/[email protected]
with:
jacoco-csv-file: code/calculatorExample/target/site/jacoco/jacoco.csv
coverage-badge-filename: badge_calculatorExample.svg
- name: Step 3.2.1 - Have GitHub Actions Build Maven complexNumber Project
run: cd code/complexNumber ; mvn -B package --file pom.xml
- name: Step 3.2.2 - Generate JaCoCo Badge complexNumber Project
id: jacoco2
uses: cicirello/[email protected]
with:
jacoco-csv-file: code/complexNumber/target/site/jacoco/jacoco.csv
coverage-badge-filename: badge_complexNumber.svg
- name: Step 3.3.1 - Have GitHub Actions Build Maven CucumberTestExample Project
run: cd code/CucumberTestExample ; mvn -B package --file pom.xml
- name: Step 3.4.1 - Have GitHub Actions Build Maven EasyMockExample Project
run: cd code/EasyMockExample ; mvn -B package --file pom.xml
- name: Step 3.5.1 - Have GitHub Actions Build Maven MavenExamples Project
run: cd code/MavenExamples/AppEx0 ; mvn -B package --file pom.xml
- name: Step 3.5.2 - Generate JaCoCo Badge MavenExamples Project
id: jacoco4
uses: cicirello/[email protected]
with:
jacoco-csv-file: code/MavenExamples/AppEx0/target/site/jacoco/jacoco.csv
coverage-badge-filename: badge_MavenExamples.svg
- name: Step 3.6.1 - Have GitHub Actions Build Maven MockitoATM Project
run: cd code/MockitoATM ; mvn -B package --file pom.xml
- name: Step 3.6.2 - Generate JaCoCo Badge MockitoATM Project
id: jacoco5
uses: cicirello/[email protected]
with:
jacoco-csv-file: code/MockitoATM/target/site/jacoco/jacoco.csv
coverage-badge-filename: badge_MockitoATM.svg
- name: Step 3.7.1 - Have GitHub Actions Build Maven TDDExampleFactorial Project
run: cd code/TDDExampleFactorial ; mvn -B package --file pom.xml
- name: Step 3.7.2 - Generate JaCoCo Badge TDDExampleFactorial Project
id: jacoco6
uses: cicirello/[email protected]
with:
jacoco-csv-file: code/TDDExampleFactorial/target/site/jacoco/jacoco.csv
coverage-badge-filename: badge_TDDExampleFactorial.svg
- name: Steps 4 - Commit the badges (if it changed)
run: |
if [[ `git status --porcelain` ]]; then
git config --global user.name 'Javier-DlaP'
git config --global user.email '[email protected]'
git add -A
git commit -m "Autogenerated JaCoCo coverage badges"
git push
fi
- name: Steps 5.1 - Upload JaCoCo coverage report calculatorExample project
uses: actions/upload-artifact@v2
with:
name: jacoco-report-calculatorExample
path: code/calculatorExample/target/site/jacoco/
- name: Steps 5.2 - Upload JaCoCo coverage report complexNumber project
uses: actions/upload-artifact@v2
with:
name: jacoco-report-complexNumber
path: code/complexNumber/target/site/jacoco/
- name: Steps 5.3 - Upload JaCoCo coverage report MavenExamples project
uses: actions/upload-artifact@v2
with:
name: jacoco-report-MavenExamples
path: code/MavenExamples/AppEx0/target/site/jacoco/
- name: Steps 5.4 - Upload JaCoCo coverage report MockitoATM project
uses: actions/upload-artifact@v2
with:
name: jacoco-report-MockitoATM
path: code/MockitoATM/target/site/jacoco/
- name: Steps 5.5 - Upload JaCoCo coverage report TDDExampleFactorial project
uses: actions/upload-artifact@v2
with:
name: jacoco-report-TDDExampleFactorial
path: code/TDDExampleFactorial/target/site/jacoco/