-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTaskfile.yaml
99 lines (84 loc) · 1.88 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
# https://taskfile.dev
version: "3"
vars:
CARGO_BIN: ~/.cargo/bin/
tasks:
install-nextest:
status:
- test -f {{.CARGO_BIN}}/cargo-nextest
cmds:
- curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C {{.CARGO_BIN}}
install-pytest:
status:
- which pytest
cmds:
- python3 -m pip install pytest
clone-licenses:
status:
- test -d choosealicense.com
cmds:
- git clone --depth 1 https://github.com/github/choosealicense.com.git
check:
cmds:
- cargo check --all {{.CLI_ARGS}}
format:
cmds:
- cargo fmt --all {{.CLI_ARGS}}
lint:
cmds:
- >
cargo clippy
--examples --tests --benches --bins --lib --workspace
-- -D clippy::pedantic -D clippy::dbg-macro -D warnings
doc:
env:
RUSTDOCFLAGS: "-Dwarnings"
cmds:
- cargo doc {{.CLI_ARGS}}
pytest:
deps:
- install-pytest
cmds:
- pytest {{.CLI_ARGS}} tests/
nextest:
deps:
- install-nextest
env:
CLICOLOR_FORCE: "yes"
cmds:
- cargo nextest run --no-fail-fast {{.CLI_ARGS}}
- cargo build --no-default-features
doctest:
cmds:
- cargo test --doc
bench:
desc: "run benchmarks"
deps:
- clone-licenses
cmds:
- cargo bench {{.CLI_ARGS}}
release:
desc: "build and upload a new release"
cmds:
- which gh
- test {{.CLI_ARGS}}
- cat Cargo.toml | grep -F 'version = "{{.CLI_ARGS}}"'
- cargo publish
- git tag {{.CLI_ARGS}}
- git push
- git push --tags
- gh release create --generate-notes {{.CLI_ARGS}}
test:
desc: "run all tests"
cmds:
- task: pytest
- task: nextest
- task: doctest
all:
desc: "run all code formatters, linters, and tests"
cmds:
- task: format
- task: check
- task: lint
- task: doc
- task: test