-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
138 lines (115 loc) · 2.96 KB
/
Makefile.toml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
[config]
# -------------------------- generic/common tasks ---------------------------- #
[tasks.format]
toolchain = "nightly"
command = "cargo"
args = ["fmt"]
[tasks.docs]
toolchain = "stable"
command = "cargo"
args = ["doc"]
# --------------------------------- testing ---------------------------------- #
[tasks.test_env]
script_runner = "@duckscript"
script = '''
set_env RUSTFLAGS "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
set_env RUSTDOCFLAGS "-Cpanic=abort"
set_env CARGO_INCREMENTAL 0
'''
[tasks.testcov]
command = "grcov"
args = [
".",
"-s", "src",
"--binary-path", "target/debug/",
"-t", "html",
"--branch",
"--ignore-not-existing",
"-o", "target/debug/coverage",
]
[tasks.clean_testcov]
script_runner = "@duckscript"
script = '''
testcov_files = glob_array target/**/*.gcda
for file in ${testcov_files}
rm ${file}
end
'''
[tasks.build_test]
toolchain = "nightly"
command = "cargo"
args = ["build"]
dependencies = ["test_env", "format"]
[tasks.run_tests]
toolchain = "nightly"
command = "cargo"
args = ["test"]
dependencies = ["test_env", "build_test"]
[tasks.test]
clear = true
dependencies = ["clean_testcov", "run_tests", "testcov"]
# -------------------------------- production -------------------------------- #
[tasks.production_env]
script_runner = "@duckscript"
script = '''
set_env RUSTFLAGS "-Copt-level=3 -Coverflow-checks=off"
set_env CARGO_INCREMENTAL 0
'''
[tasks.production_build]
toolchain = "stable"
command = "cargo"
args = ["build", "--release"]
dependencies = ["production_env", "format", "run_tests"]
[tasks.production]
clear = true
dependencies = ["production_env", "production_build"]
# ------------------------------- benchmarking ------------------------------- #
[tasks.bench]
clear = true
# TODO:
# -------------------------------- publishing -------------------------------- #
[tasks.bump_patch]
dependencies = ["run_tests"]
command = "cargo"
args = ["semver", "bump", "patch"]
[tasks.bump_minor]
dependencies = ["run_tests"]
command = "cargo"
args = ["semver", "bump", "minor"]
[tasks.bump_major]
dependencies = ["run_tests"]
command = "cargo"
args = ["semver", "bump", "major"]
[tasks.push_git_nobump]
dependencies = ["run_tests"]
script_runner = "@duckscript"
script = '''
exec --fail-on-error git pull
exec --fail-on-error git push
'''
[tasks.push_git_bump]
dependencies = ["production", "docs"]
script_runner = "@duckscript"
script = '''
fn git
exec --fail-on-error git ${1} ${2}
end
version = cargo semver get
git checkout latest
git merge master
git branch v${version}
git checkout master
git pull
git push
'''
[tasks.push_crates]
dependencies = ["push_git_bump"]
[tasks.publish_patch]
dependencies = ["bump_patch", "push_crates"]
[tasks.publish_minor]
dependencies = ["bump_minor", "push_crates"]
[tasks.publish_major]
dependencies = ["bump_major", "push_crates"]
# git master branch: development
# -> side branch 'latest'
# -> release branches