-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
90 lines (73 loc) · 1.9 KB
/
Taskfile.yml
File metadata and controls
90 lines (73 loc) · 1.9 KB
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
version: '3'
vars:
maybe_nightly: { sh: cargo version | grep -q 'nightly' && echo 'nightly' || echo '' }
tasks:
CI:
preconditions:
- if [ -d ./target ]; then find -regex ".*target\|.*Cargo.lock" -exec rm -rf {} +; fi # clean cache for correctness
cmds:
- echo "CLEANUP CHECK" && ls -al
- task: ci
ci:
deps:
- test
- check
- bench-dryrun
test:
deps:
- test:doc
- test:lib
- test:examples
check:
deps:
- check:fmt
- check:clippy
bench:
status:
- '[ "{{.maybe_nightly}}" != "nightly" ]' # skip if not nightly
cmds:
- task: bench:all
bench-dryrun:
status:
- '[ "{{.maybe_nightly}}" != "nightly" ]' # skip if not nightly
cmds:
- task: bench:dryrun
###########################################################################
##### test #####
test:doc:
dir: ./serdev
cmds:
- cargo test --doc --all-features
test:lib:
cmds:
- cargo test --lib --no-default-features
- cargo test --lib --features derive,
test:examples:
dir: examples
cmds:
- for file in `ls ./examples`; do cargo run --example "${file%.*}"; done
- cd reexport && cargo run
##### check #####
check:fmt:
cmds:
- cargo fmt --all --check
check:clippy:
vars:
targets: # all, but skip benches on non-nightly
sh: |
if [ "{{.maybe_nightly}}" = "nightly" ]; then
echo "--all-targets"
else
echo "--lib --tests --examples"
fi
cmds:
- cargo clippy {{.targets}} --no-default-features -- --deny warnings
- cargo clippy {{.targets}} --features derive, -- --deny warnings
- cd examples && cargo clippy --examples -- --deny warnings
##### bench #####
bench:all:
cmds:
- cargo bench
bench:dryrun:
cmds:
- cargo bench --no-run