-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
62 lines (52 loc) · 2.1 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
# Taskfile (https://taskfile.dev)
version: "3"
# When tasks/commands are executed in parallel, the
# output should be prefixed with the name of the task,
# so it is easier to follow what is happening.
output: "prefixed"
# The interval to check for changes when watching tasks.
interval: "500ms"
tasks:
run:
aliases: [ r ]
desc: "Run the somgen cli tool."
cmds:
- cd ./cmd/somgen && go run main.go -- {{.CLI_ARGS}}
gen:
aliases: [ g ]
desc: "Generate code for the example codebase."
cmds:
- cd internal/tests/basic && go generate gen.go
sources:
- internal/tests/basic/model/**/*
generates:
- internal/tests/basic/gen/som/**/*
lint:
aliases: [ l ]
desc: "Lint the codebase with the golangci-lint tool."
cmds:
- golangci-lint run
test:
aliases: [ t ]
desc: "Execute all go tests."
deps: [ gen ]
cmds:
- go test -v ./...
- cd internal/tests/basic && go test -v ./...
test-clean:
aliases: [ tc ]
desc: "Execute all go tests without cache."
deps: [ gen ]
cmds:
- go test -count=1 ./...
- cd internal/tests/basic && go test -v -count=1 ./...
benchmark:
aliases: [ b ]
desc: "Run benchmark tests."
cmds:
- go test -bench=. | tee ../graphic/out.dat ; \
awk '/Benchmark/{count ++; gsub(/BenchmarkTest/,""); printf("%d,%s,%s,%s\n",count,$$1,$$2,$$3)}' ../graphic/out.dat > ../graphic/final.dat ; \
gnuplot -e "file_path='../graphic/final.dat'" -e "graphic_file_name='../graphic/operations.png'" -e "y_label='number of operations'" -e "y_range_min='000000000''" -e "y_range_max='400000000'" -e "column_1=1" -e "column_2=3" ../graphic/performance.gp ; \
gnuplot -e "file_path='../graphic/final.dat'" -e "graphic_file_name='../graphic/time_operations.png'" -e "y_label='each operation in nanoseconds'" -e "y_range_min='000''" -e "y_range_max='45000'" -e "column_1=1" -e "column_2=4" ../graphic/performance.gp ; \
rm -f ../graphic/out.dat ../graphic/final.dat ; \
echo "'graphic/operations.png' and 'graphic/time_operations.png' graphics were generated."