add coverage.html

This commit is contained in:
Motiejus Jakštys 2021-06-01 08:42:23 +03:00
parent 21cafcfc16
commit ff11d83ab0
3 changed files with 14 additions and 22 deletions

View File

@ -1,30 +1,11 @@
image: alpine/edge image: alpine/edge
packages: packages:
- go - go
- make
sources: sources:
- https://git.sr.ht/~motiejus/undocker - https://git.sr.ht/~motiejus/undocker
tasks: tasks:
- test: | - test: |
cd undocker make -C coverage.html
go test -cover ./...
- build-linux-amd64: |
cd undocker
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o undocker-linux-amd64
- build-linux-arm64: |
cd undocker
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o undocker-linux-arm64
- build-darwin-amd64: |
cd undocker
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o undocker-darwin-amd64
- build-darwin-arm64: |
cd undocker
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o undocker-darwin-arm64
- build-windows-amd64: |
cd undocker
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o undocker-windows-amd64.exe
artifacts: artifacts:
- undocker/undocker-linux-amd64 - undocker/coverage.html
- undocker/undocker-linux-arm64
- undocker/undocker-darwin-amd64
- undocker/undocker-darwin-arm64
- undocker/undocker-windows-amd64.exe

1
.gitignore vendored
View File

@ -1 +1,2 @@
/undocker /undocker
coverage.html

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
.PHONY: test
test:
go test -cover ./...
.INTERMEDIATE: coverage.out
coverage.out: $(shell git ls-files '*.go')
go test -coverprofile $@ ./...
coverage.html: coverage.out
go tool cover -html=$< -o $@