-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (120 loc) · 3.77 KB
/
unit.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Unit-Test
on:
push
jobs:
endpoint-service-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk
- name: Run tests
run: |
cd src/endpoint-configuration-service/
mvn clean verify
- name: Setup .NET Core # Required to execute ReportGenerator
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
- name: ReportGenerator
uses: danielpalme/[email protected]
with:
reports: 'src/endpoint-configuration-service/target/site/jacoco/jacoco.xml'
targetdir: 'coveragereport'
reporttypes: 'lcov'
sourcedirs: 'src/endpoint-configuration-service/src/main/java'
- name: Upload coverage-report
uses: actions/upload-artifact@v2
with:
name: ecs
path: coveragereport/lcov.info
ishare-auth-provider-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Go test
run: |
cd src/ishare-auth-provider/
go test -v -covermode=count -coverprofile=coverage.out
- name: Transform report
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
working-directory: src/ishare-auth-provider/
- name: Upload coverage-report
uses: actions/upload-artifact@v2
with:
name: auth-provider
path: src/ishare-auth-provider/coverage.lcov
cached-auth-filter-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.3
- name: Go test
run: |
cd src/cached-auth-filter/
go test -v -tags=proxytest -covermode=count -coverprofile=coverage.out
- name: Transform report
uses: jandelgado/[email protected]
with:
infile: coverage.out
outfile: coverage.lcov
working-directory: src/cached-auth-filter/
- name: Make it coveralls compatible
run: |
cd src/cached-auth-filter/
sed -i 's/fiware.org/src/g' coverage.lcov
- name: Upload coverage-report
uses: actions/upload-artifact@v2
with:
name: cached-auth-filter
path: src/cached-auth-filter/coverage.lcov
aggregate-report:
needs: [endpoint-service-test, ishare-auth-provider-test, cached-auth-filter-test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: download ecs report
uses: actions/download-artifact@v2
with:
name: ecs
path: coverage/ecs
- name: download auth-provider report
uses: actions/download-artifact@v2
with:
name: auth-provider
path: coverage/auth-provider
- name: download cached-auth-filter report
uses: actions/download-artifact@v2
with:
name: cached-auth-filter
path: coverage/cached-auth-filter
- name: prepare
run: |
sudo apt-get install -y lcov
- name: aggregate
run: |
cd coverage
cat cached-auth-filter/coverage.lcov
cat auth-provider/coverage.lcov
lcov -a auth-provider/coverage.lcov -a cached-auth-filter/coverage.lcov -a ecs/lcov.info -o ../lcov.info
- name: Upload coverage-report
uses: actions/upload-artifact@v2
with:
path: lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/lcov.info