-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
63 lines (56 loc) · 1.66 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
---
version: '3'
vars:
CURDIR:
sh: pwd
SOURCE_FOLDER: src
tasks:
default:
cmds:
- task: test
- task: build
mod:
desc: update go modules, add submodules to go root
cmds:
- cmd: |
export SOURCE_FOLDER={{.SOURCE_FOLDER}}
curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_add_sub_packages.sh | bash
build:
desc: build binary using remote ghwfe script, requires curl
cmds:
- cmd: |
export SOURCE_FOLDER={{.SOURCE_FOLDER}}
curl -sL https://raw.githubusercontent.com/triole/ghwfe/master/sh/go_build.sh | bash
test:
desc: run go tests
cmds:
- cmd: >-
for fol in {{.MODULES}}; do
echo -e "\nTest ${fol}"
cd "${fol}"
go test -timeout 30s -trace go.trace \
-race -cover -bench=. .
done
- task: docker
vars:
MODULES:
sh: find $(pwd)/src -maxdepth 1 -type d | sort | tr '\n'
' '
deploy:
desc: build and copy to my personal arch mybins folder
cmds:
- task: build
- cmd: cp -rpf build/* ${HOME}/tools/arch/mybins/
docker:
desc: run docker to test memory issue inside
dir: testdata
cmds:
- cmd: cp "{{.CURDIR}}/build/linux_x86_64/fileaxe" "{{.CURDIR}}/testdata/bin/"
- cmd: cp "$(which fakedata)" "{{.CURDIR}}/testdata/bin/"
- cmd: docker build --tag logaxe-test .
- cmd: >-
docker ps -a | grep logaxe-test | grep -Po "^[0-9a-f]+"
| xargs -i docker rm {}
- cmd: >-
docker run --kernel-memory="64m" --memory-swap="128m"
--memory="128m" --name logaxe-test logaxe-test