-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.toml
107 lines (81 loc) · 2.99 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
[env]
AFL_SKIP_CPUFREQ = "true"
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES = "true"
### Fuzzing tasks ##############################################################
[tasks.fuzz]
alias = "afl"
[tasks.build-afl]
description = "Compiles the library to be used with the AFL fuzzer."
install_crate = "afl"
command = "cargo"
args = ["afl", "build", "--manifest-path", "afl/Cargo.toml", "--release"]
[tasks.afl]
description = "Runs the American Fuzzy Lop fuzzer on the library."
dependencies = ["build-afl"]
install_crate = "afl"
command = "cargo"
args = ["afl", "fuzz", "-i", "afl/in", "-o", "afl/out", "afl/target/release/packageurl-fuzz"]
### CI setup flow ##############################################################
[tasks.ci-install-sccache]
description = "Install the `sccache` compiled executable from GitHub releases."
# condition_script = ['test ! -f "$HOME/.cargo/bin/sccache"']
script = [
'''
LATEST=$(cargo search sccache | grep sccache | cut -f2 -d"\"")
URL="https://github.com/mozilla/sccache/releases/download/${LATEST}/sccache-${LATEST}-x86_64-unknown-linux-musl.tar.gz"
curl -SsL $URL | tar xzv -C /tmp
mv /tmp/sccache-${LATEST}-x86_64-unknown-linux-musl/sccache $HOME/.cargo/bin/sccache
'''
]
[tasks.ci-setup-sccache]
env = { "RUSTC_WRAPPER" = "sccache" }
condition_script = ['test ! -d "$SCCACHE_DIR"']
script = ['mkdir "$SCCACHE_DIR"']
[tasks.ci-setup-flow]
condition = { env = { "TRAVIS" = "true" } }
dependencies = [
'ci-install-sccache',
'ci-setup-sccache',
]
### CI flow ####################################################################
[tasks.ci-flow]
env = { "RUSTC_WRAPPER" = "sccache" }
[tasks.pre-coverage]
alias = "ci-setup-tarpaulin"
[tasks.ci-setup-tarpaulin]
condition = { env = { "TRAVIS_RUST_VERSION" = "nightly" } }
env = { "RUSTFLAGS" = "--cfg procmacro2_semver_exempt" }
command = "cargo"
args = ["install", "-f", "cargo-tarpaulin"]
#script = [
# '''
# LATEST=$(cargo search -q cargo-tarpaulin | grep cargo-tarpaulin | cut -f2 -d"\"")
# URL="https://github.com/xd009642/tarpaulin/releases/download/${LATEST}/cargo-tarpaulin-${LATEST}-travis.tar.gz"
# curl -SsL $URL | tar xzvC $HOME/.cargo/bin
# '''
#]
[tasks.coverage]
alias = "ci-coverage"
[tasks.ci-coverage]
condition = { env = { "TRAVIS_RUST_VERSION" = "nightly" } }
install_crate = "cargo-tarpaulin"
command = "cargo"
args = ["tarpaulin", "--out=Xml", "--ciserver=travis-ci"]
[tasks.post-ci-flow]
alias = "audit"
[tasks.build-verbose]
alias = "build"
[tasks.test-verbose]
alias = "test"
### Release flow ###############################################################
[tasks.pre-publish]
dependencies = ["verify-project"]
[tasks.publish]
args = ["publish", "--token", "$CRATES_IO_TOKEN"]
[tasks.post-publish]
dependencies = ["chandler"]
[tasks.chandler]
description = "Update GitHub release notes with appropriate CHANGELOG sections"
install_script = ["gem install chandler -n target/gems"]
command = "target/gems/chandler"
args = ["push", "--github=$(echo $CARGO_MAKE_CRATE_REPOSITORY | cut -d/ -f4-5)"]