File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 39
39
- name : Build all targets.
40
40
run : |
41
41
make build-all
42
- make test-all
42
+ make test-all WITH_COVERAGE=true
43
+ - name : Upload test coverage
44
+ uses : actions/upload-artifact@v2
45
+ if : github.event_name == 'pull_request'
46
+ with :
47
+ name : coverage
48
+ path : coverage.html
43
49
- name : Sign into Azure
44
50
uses : azure/login@v1
51
+ if : github.event_name != 'pull_request'
45
52
with :
46
53
client-id : ${{ secrets.AZURE_CLIENT_ID }}
47
54
tenant-id : ${{ secrets.AZURE_TENANT_ID }}
Original file line number Diff line number Diff line change 9
9
10
10
# Ignore ie logs
11
11
ie.log
12
+
13
+ # Ignore test coverage
14
+ coverage.html
15
+ coverage.out
Original file line number Diff line number Diff line change @@ -21,10 +21,19 @@ install-ie:
21
21
22
22
# ------------------------------ Test targets ----------------------------------
23
23
24
+ WITH_COVERAGE := false
25
+
24
26
test-all :
25
- @echo " Running all tests..."
26
27
@go clean -testcache
28
+ ifeq ($(WITH_COVERAGE ) , true)
29
+ @echo "Running all tests with coverage..."
30
+ @go test -v -coverprofile=coverage.out ./...
31
+ @go tool cover -html=coverage.out -o coverage.html
32
+ else
33
+ @echo "Running all tests..."
27
34
@go test -v ./...
35
+ endif
36
+
28
37
29
38
SUBSCRIPTION ?= 00000000-0000-0000-0000-000000000000
30
39
SCENARIO ?= ./README.md
You can’t perform that action at this time.
0 commit comments