File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 - name : Build all targets.
4040 run : |
4141 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
4349 - name : Sign into Azure
4450 uses : azure/login@v1
51+ if : github.event_name != 'pull_request'
4552 with :
4653 client-id : ${{ secrets.AZURE_CLIENT_ID }}
4754 tenant-id : ${{ secrets.AZURE_TENANT_ID }}
Original file line number Diff line number Diff line change 99
1010# Ignore ie logs
1111ie.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:
2121
2222# ------------------------------ Test targets ----------------------------------
2323
24+ WITH_COVERAGE := false
25+
2426test-all :
25- @echo " Running all tests..."
2627 @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..."
2734 @go test -v ./...
35+ endif
36+
2837
2938SUBSCRIPTION ?= 00000000-0000-0000-0000-000000000000
3039SCENARIO ?= ./README.md
You can’t perform that action at this time.
0 commit comments