-
Notifications
You must be signed in to change notification settings - Fork 14
/
magefile.go
64 lines (59 loc) · 967 Bytes
/
magefile.go
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
61
62
63
64
//+build mage
package main
import (
"fmt"
"github.com/magefile/mage/sh"
"os"
)
// Run Integrationtests
func Integration() error {
params := []string{
"test",
"-v",
"./...",
"-p",
"1",
"-coverprofile=cover.out",
"-coverprofile=coverage.txt",
"-covermode=atomic",
}
return sh.RunV("go", params...)
}
// Run Unittests
func Test() error {
params := []string{
"test",
"-v",
"./...",
"-short",
"-coverprofile=cover.out",
"-coverprofile=coverage.txt",
"-covermode=atomic",
}
return sh.RunV("go", params...)
}
// Run linting checks
func Lint() error {
cwd, err := os.Getwd()
if err != nil {
return err
}
params := []string{
"run",
"--rm",
"-v",
fmt.Sprintf("%s:/go/src/netrasp", cwd),
"-w",
"/go/src/netrasp",
"-e",
"GO111MODULE=on",
"-e",
"GOPROXY=https://proxy.golang.org",
"golangci/golangci-lint:v1.36",
"golangci-lint",
"run",
"--timeout",
"300s",
}
return sh.RunV("docker", params...)
}