-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.toml
84 lines (69 loc) · 1.82 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
[config]
default_to_workspace = false
[env]
CARGO_TERM_COLOR = "always"
[tasks.pre-commit]
run_task = { name = ["test", "clippy", "doc", "check_fmt"], parallel = true }
[tasks.ci_main]
run_task = { name = ["test", "clippy", "doc", "check_fmt"], parallel = true }
[tasks.ci_post]
run_task = { name = ["no_untracked", "no_modified", "release"] }
[tasks.ci]
run_task = { name = ["ci_main", "ci_post"] }
[tasks.test]
command = "cargo"
args = ["test"]
[tasks.clippy]
command = "cargo"
args = ["clippy", "--all-targets", "--", "--deny", "warnings"]
[tasks.doc]
command = "cargo"
args = ["doc"]
[tasks.check_fmt]
command = "cargo"
args = ["fmt", "--check"]
[tasks.lint_commit_msg_from_stdin]
script = '''
#!/usr/bin/env bash
set -euxo pipefail
cargo bin conventional_commits_linter --allow-angular-type-only --from-stdin
'''
[tasks.table_of_contents]
script = '''
#!/usr/bin/env bash
set -euxo pipefail
toc=$(cargo bin md-toc --header "# Table of contents" README.md | grep --invert-match --fixed-strings '1. [Table of contents]')
MARKER='<!-- TOC -->'
cargo bin sd "$MARKER[\S\s]*$MARKER" $"$MARKER$toc\n$MARKER" README.md
'''
[tasks.no_modified]
script = '''
#!/usr/bin/env bash
set -euxo pipefail
if ! git diff --exit-code; then
echo "modified files detected"
exit 1
fi
'''
[tasks.no_untracked]
script = '''
#!/usr/bin/env bash
set -euxo pipefail
if [[ `git ls-files --exclude-standard --others` ]]; then
echo "untracked files detected"
exit 1
fi
'''
[tasks.release]
condition = { env = { "GITHUB_REF_TYPE" = "branch", "GITHUB_REF_NAME" = "master" } }
script = '''
#!/usr/bin/env bash
set -euxo pipefail
npm install --global \
semantic-release@19 \
@semantic-release-cargo/semantic-release-cargo@2 \
@semantic-release/changelog@6 \
@semantic-release/git@10 \
conventional-changelog-conventionalcommits@5
semantic-release
'''