-
Notifications
You must be signed in to change notification settings - Fork 69
/
Taskfile.yml
117 lines (100 loc) · 3 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
version: "3"
vars:
APP_NAME: "massastation"
BIN_DIR: "./build/{{.APP_NAME}}"
includes:
darwin: tasks/Taskfile_darwin.yml
linux: tasks/Taskfile_linux.yml
windows: tasks/Taskfile_windows.yml
internal:
taskfile: tasks/Taskfile_internal.yml
internal: true
tasks:
install:
desc: Installs build dependencies
cmds:
- cmd: go install github.com/go-swagger/go-swagger/cmd/swagger@latest
- cmd: go install golang.org/x/tools/cmd/stringer@latest
- cmd: go install go.uber.org/mock/[email protected]
install-dev:
desc: Installs development dependencies (fmt, lint, etc.)
cmds:
- cmd: go install github.com/golangci/golangci-lint/cmd/[email protected]
- cmd: go install github.com/daixiang0/gci@latest
- cmd: go install mvdan.cc/gofumpt@latest
- task: install-dev-win
install-dev-win:
desc: Installs Windows development dependencies
platforms: [windows]
cmds:
- cmd: mkdir -p build/massastation
- cmd: curl -o build/massastation/mar-tools-win64.zip https://archive.torproject.org/tor-package-archive/torbrowser/12.5.1/mar-tools-win64.zip
generate:
cmds:
- task: generate-dirs
- cmd: go generate ./...
test:
cmds:
- cmd: go test -v -timeout 60s ./...
test-e2e:
cmds:
- cmd: scripts/test-e2e.sh
test-coverage:
cmds:
- cmd: go test -timeout 60s ./... -coverprofile=coverage.coverprofile
fmt:
desc: Formats all files
cmds:
- cmd: go mod tidy
- cmd: gofumpt -l -w .
- cmd: gci write .
- task: fmt-web
- cmd: golangci-lint run --fix
fmt-web:
desc: Formats web files
dir: web/massastation
cmds:
- cmd: npm run fmt
run:
desc: Runs MassaStation in DEBUG mode
cmds:
- cmd: "{{.BIN_DIR}}/{{.APP_NAME}}{{.BIN_EXT}}"
vars:
BIN_EXT: '{{if eq .OS "windows"}}.exe{{end}}'
env:
LOG_LEVEL: DEBUG
build:
desc: Builds MassaStation
cmds:
- task: linux:int-build
- task: darwin:int-build
- task: windows:int-build
build-run:
desc: Builds and runs MassaStation
cmds:
- task: build
- task: run
package:
desc: Packages MassaStation using fyne
platforms: [linux, darwin]
cmds:
- cmd: fyne package -name MassaStation -icon ./int/systray/embedded/logo.png -appID net.massalabs.massastation -exe massastation
generate-dirs:
desc: Generates required directories for MassaStation
cmds:
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}"
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}/logs"
- cmd: "{{.SUDO}} mkdir -p {{.CONFIG_DIR}}/plugins"
status:
- test -d "{{.CONFIG_DIR}}"
- test -d "{{.CONFIG_DIR}}/logs"
- test -d "{{.CONFIG_DIR}}/plugins"
vars:
CONFIG_DIR: '{{if eq OS "windows"}}{{.BIN_DIR}}{{else}}/usr/local/share/massastation{{end}}'
SUDO: '{{if ne OS "windows"}}sudo{{end}}'
all:
desc: Runs install, generate, build-run
cmds:
- task: install
- task: generate
- task: build-run