-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTaskfile.yml
More file actions
187 lines (153 loc) · 5.96 KB
/
Copy pathTaskfile.yml
File metadata and controls
187 lines (153 loc) · 5.96 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
version: "3"
tasks:
# Test
# --------------------------------------------------------------------------------
test:unit:
desc: Run unit tests
summary: |
Run unit tests.
Options:
filter=MyClass Filter tests by class or method name
coverage=true Collect code coverage
verbosity=detailed Set verbosity (quiet|minimal|normal|detailed|diagnostic)
configuration=Debug Set build configuration
cmd: >-
python3 dev/scripts/test.py --unit
{{if (default "" .filter)}}--filter {{.filter}}{{end}}
{{if eq (default "false" .coverage) "true"}}--coverage{{end}}
{{if (default "" .verbosity)}}--verbosity {{.verbosity}}{{end}}
{{if (default "" .configuration)}}--configuration {{.configuration}}{{end}}
test:integration:
desc: Run integration tests
summary: |
Run integration tests.
Options:
filter=MyClass Filter tests by class or method name
coverage=true Collect code coverage
verbosity=detailed Set verbosity (quiet|minimal|normal|detailed|diagnostic)
configuration=Debug Set build configuration
cmd: >-
python3 dev/scripts/test.py --integration
{{if (default "" .filter)}}--filter {{.filter}}{{end}}
{{if eq (default "false" .coverage) "true"}}--coverage{{end}}
{{if (default "" .verbosity)}}--verbosity {{.verbosity}}{{end}}
{{if (default "" .configuration)}}--configuration {{.configuration}}{{end}}
test:
desc: Run all tests
summary: |
Run all tests (unit + integration).
Options:
filter=MyClass Filter tests by class or method name
coverage=true Collect code coverage
verbosity=detailed Set verbosity (quiet|minimal|normal|detailed|diagnostic)
configuration=Debug Set build configuration
cmd: >-
python3 dev/scripts/test.py
{{if (default "" .filter)}}--filter {{.filter}}{{end}}
{{if eq (default "false" .coverage) "true"}}--coverage{{end}}
{{if (default "" .verbosity)}}--verbosity {{.verbosity}}{{end}}
{{if (default "" .configuration)}}--configuration {{.configuration}}{{end}}
# Coverage
# --------------------------------------------------------------------------------
coverage:install:
desc: Install coverage reporting tools
cmd: dotnet tool restore
status:
- dotnet reportgenerator --version
coverage:report:
desc: Generate coverage reports
cmd: python3 dev/scripts/coverage.py report
coverage:check:
desc: Compare measured coverage against the baseline
cmd: python3 dev/scripts/coverage.py check
coverage:update:
desc: Updates the coverage baseline
cmd: python3 dev/scripts/coverage.py update
coverage:clean:
desc: Remove coverage results and reports
cmd: python3 dev/scripts/coverage.py clean
# Build
# --------------------------------------------------------------------------------
build:
desc: Build the solution
summary: |
Build the solution.
Options:
target=lib Build only the Valkey.Glide library
cmd: >-
dotnet build
{{if eq (default "" .target) "lib"}}sources/Valkey.Glide/{{end}}
--configuration Release
# Lint
# --------------------------------------------------------------------------------
lint:
desc: "Run all linters"
deps:
- lint:rust
- lint:csharp
- lint:yaml
- lint:actions
- lint:markdown
lint:rust:
desc: "Run Rust linting"
dir: rust
cmds:
- cargo fmt --all -- --check
- cargo clippy --all-features --all-targets -- -D warnings
- cargo deny check
- RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --document-private-items
lint:csharp:
desc: "Run C# linting"
cmds:
- dotnet format --verify-no-changes
# Shutdown build server to release file locks before lint build
- dotnet build-server shutdown
- dotnet build --configuration Lint --framework net8.0 -m:1
lint:yaml:
desc: "Run YAML linting"
cmd: npx --yes prettier --check "**/*.yml"
lint:actions:
desc: "Run GitHub Actions linting"
cmd: actionlint
lint:markdown:
desc: "Run Markdown linting"
cmd: npx --yes markdownlint-cli2 "**/*.md"
# Format
# --------------------------------------------------------------------------------
format:
desc: "Run all formatters"
deps:
- format:rust
- format:csharp
- format:yaml
- format:markdown
format:rust:
desc: "Run Rust formatting"
dir: rust
cmd: cargo fmt --all
format:csharp:
desc: "Run C# formatting"
cmd: dotnet format
format:yaml:
desc: "Run YAML formatting"
cmd: npx --yes prettier --write --cache "**/*.yml"
format:markdown:
desc: "Run Markdown formatting"
cmd: npx --yes markdownlint-cli2 --fix "**/*.md"
# Additional checks
# --------------------------------------------------------------------------------
check:
desc: "Run all checks"
deps:
- check:examples
- check:links
- check:todos
check:examples:
desc: "Check C# examples in comments"
cmd: python3 dev/scripts/check_examples.py
check:links:
desc: "Check for broken links"
cmd: lychee --config lychee.toml .
check:todos:
desc: "Check that TODOs reference an open GitHub issue"
cmd: python3 dev/scripts/check_todos.py