-
-
Notifications
You must be signed in to change notification settings - Fork 398
/
Copy pathTaskfile.yml
47 lines (39 loc) · 1.46 KB
/
Taskfile.yml
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
version: '2'
tasks:
build:
desc: Build the project
cmds:
- go build -v -i {{.LDFLAGS}}
test:
desc: Run the full testsuite, `legacy` will be skipped
cmds:
- task: test-unit
- task: test-integration
test-unit:
desc: Run unit tests only
cmds:
- go test -short {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }}
test-integration:
desc: Run integration tests only
cmds:
- go test -run Integration {{ default "-v" .GOFLAGS }} -coverprofile=coverage_integ.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
test-legacy:
desc: Run tests for the `legacy` package
cmds:
- go test {{ default "-v" .GOFLAGS }} ./legacy/...
vars:
DEFAULT_TARGETS: "./arduino/... ./auth/... ./cli/... ./commands/... ./executils/... ./version/..."
# build vars
VERSIONSTRING: "0.3.6-alpha.preview"
COMMIT:
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
LDFLAGS: >
-ldflags '-X github.com/arduino/arduino-cli/version.versionString={{.VERSIONSTRING}}
-X github.com/arduino/arduino-cli/version.commit={{.COMMIT}}'
# test vars
GOFLAGS: "-timeout 5m -v -coverpkg=./... -covermode=atomic"
TEST_VERSIONSTRING: "0.0.0-test.preview"
TEST_COMMIT: "deadbeef"
TEST_LDFLAGS: >
-ldflags '-X github.com/arduino/arduino-cli/version.versionString={{.TEST_VERSIONSTRING}}
-X github.com/arduino/arduino-cli/version.commit={{.TEST_COMMIT}}'