-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathTaskfile.yaml
115 lines (99 loc) · 3.44 KB
/
Taskfile.yaml
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
version: 3
vars:
maybe_nightly: { sh: cargo version | grep -q 'nightly' && echo 'nightly' || echo '' }
tasks:
CI:
deps:
- task: test
- task: check
- task: bench:dryrun
test:
deps:
- task: test:deps
- task: test:doc
- task: test:examples
- task: test:samples
- task: test:no_rt
- for: [tokio, async-std, smol, nio, glommio, worker]
task: test:rt
vars: { rt: '{{.ITEM}}' }
check:
deps:
- task: check:no_rt
- for: [tokio, async-std, smol, nio, glommio]
task: check:native_rt
vars: { native_rt: '{{.ITEM}}' }
- task: check:rt_worker
bench:dryrun:
status:
- (! cargo version | grep -q 'nightly')
cmds:
- cd benches && cargo bench --features DEBUG --no-run
- cd benches_rt/vs_actix-web && cargo check
- for: [tokio, smol, nio, glommio]
cmd: cd benches_rt/{{.ITEM}} && cargo check
bench:
status:
- (! cargo version | grep -q 'nightly')
dir: ./benches
cmds:
- task: bench:dryrun
- cargo bench --features DEBUG
#### tests ####
test:deps:
cmds:
- cargo test -p ohkami_lib
- cargo test -p ohkami_openapi
test:doc:
dir: ./ohkami
cmds:
- cargo test --doc --no-default-features --features DEBUG,rt_tokio,sse,ws,{{.maybe_nightly}}
# not activating `openapi` feature for testability of README sample codes
test:examples:
dir: examples
cmds:
- cargo test
test:samples:
dir: samples
cmds:
- chmod +x ./test.sh
- ./test.sh
test:no_rt:
dir: ./ohkami
cmds:
- cargo test --lib --features DEBUG,{{.maybe_nightly}}
- cargo test --lib --features DEBUG,sse,ws,{{.maybe_nightly}}
- cargo test --lib --features DEBUG,openapi,{{.maybe_nightly}}
test:rt:
dir: ./ohkami
cmds:
- cargo test --lib --features rt_{{.rt}},DEBUG,{{.maybe_nightly}}
- cargo test --lib --features rt_{{.rt}},DEBUG,sse,ws,{{.maybe_nightly}}
- cargo test --lib --features rt_{{.rt}},DEBUG,openapi,{{.maybe_nightly}}
#### checks ####
# Assure buildability without "DEBUG" feature
check:no_rt:
vars:
MAYBE_NIGHTLY_FEATURES:
sh: cargo version | grep -q 'nightly' && echo '--features nightly' || echo ''
dir: ./ohkami
cmds:
- cargo check --lib {{.MAYBE_NIGHTLY_FEATURES}}
- cargo check --lib --features sse,ws,{{.maybe_nightly}}
- cargo check --lib --features openapi,{{.maybe_nightly}}
check:native_rt:
dir: ./ohkami
cmds:
- cargo check --lib --features rt_{{.native_rt}},{{.maybe_nightly}}
- cargo check --lib --features rt_{{.native_rt}},sse,{{.maybe_nightly}}
- cargo check --lib --features rt_{{.native_rt}},ws,{{.maybe_nightly}}
- cargo check --lib --features rt_{{.native_rt}},sse,ws,{{.maybe_nightly}}
- cargo check --lib --features rt_{{.native_rt}},openapi,{{.maybe_nightly}}
check:rt_worker:
dir: ohkami
cmds:
- cargo check --target wasm32-unknown-unknown --lib --features rt_worker,{{.maybe_nightly}}
- cargo check --target wasm32-unknown-unknown --lib --features rt_worker,sse,{{.maybe_nightly}}
- cargo check --target wasm32-unknown-unknown --lib --features rt_worker,ws,{{.maybe_nightly}}
- cargo check --target wasm32-unknown-unknown --lib --features rt_worker,sse,ws,{{.maybe_nightly}}
- cargo check --target wasm32-unknown-unknown --lib --features rt_worker,openapi,{{.maybe_nightly}}