forked from vakenbolt/go-test-report
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (43 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
60 lines (43 loc) · 1.72 KB
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
VERSION := $(shell grep -o 'const.*=*' version.go | cut -d '"' -f2)
MACOS := go-test-report-darwin-v$(VERSION)
LINUX := go-test-report-linux-v$(VERSION)
WINDOWS := go-test-report-windows-v$(VERSION)
LIN_DIR := release_builds/linux-amd64/
MAC_DIR := release_builds/darwin-amd64/
WIN_DIR := release_builds/windows-amd64/
.PHONY: test test-go test-js genbuild gencode genreport buildall dockertest
REPORT ?= test_report.html
genbuild: gencode
go build
gencode:
(cd embed_assets/;set -e;go build;./embed_assets)
test: test-go test-js
test-go:
go test ./...
test-js:
@if [ ! -d node_modules ]; then npm install --no-audit --no-fund; fi
npm test
genreport: genbuild
go test -json ./... | ./go-test-report -t "go-test-report tests" -o $(REPORT)
@echo "Report generated: $(REPORT)"
buildall: genbuild
echo "Building..."
mkdir -p $(LIN_DIR)
mkdir -p $(MAC_DIR)
mkdir -p $(WIN_DIR)
go mod verify
echo "Linux 64bit"
GOOS=linux GOARCH=amd64 go build -o release_builds/linux-amd64/
(cd $(LIN_DIR); shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(LINUX).sha256)
(cd $(LIN_DIR); tar -czf $(LINUX).tgz go-test-report $(LINUX).sha256)
echo "Darwin (MacOS) 64bit"
GOOS=darwin GOARCH=amd64 go build -o release_builds/darwin-amd64/
(cd $(MAC_DIR); shasum -a 256 go-test-report | cut -d ' ' -f 1 > $(MACOS).sha256)
(cd $(MAC_DIR); tar -czf $(MACOS).tgz go-test-report $(MACOS).sha256)
echo "Windows 64bit"
GOOS=windows GOARCH=amd64 go build -o release_builds/windows-amd64/
(cd $(WIN_DIR); shasum -a 256 go-test-report.exe | cut -d ' ' -f 1 > $(WINDOWS).sha256)
(cd $(WIN_DIR); zip -r $(WINDOWS).zip go-test-report.exe $(WINDOWS).sha256)
echo "...Done!"
dockertest: genbuild
docker build . -t go-test-report-test-runner:$(VERSION)