Skip to content

Commit 8af509b

Browse files
committed
ci: add missing scripts
1 parent 0b6895b commit 8af509b

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
test:
2+
@./go.test.sh
3+
.PHONY: test
4+
5+
coverage:
6+
@./go.coverage.sh
7+
.PHONY: coverage
8+
9+
generate:
10+
go generate ./...
11+
.PHONY: generate
12+
13+
build:
14+
CGO_ENABLED=0 go build ./cmd/bot
15+
16+
check_generated: generate
17+
git diff --exit-code
18+
.PHONY: check_generated

go.coverage.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
go test -v -coverpkg=./... -coverprofile=profile.out ./...
6+
go tool cover -func profile.out

go.test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# test with -race
6+
go test --timeout 5m -race ./...

0 commit comments

Comments
 (0)