forked from valkey-io/valkey-glide-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
213 lines (175 loc) · 6.75 KB
/
Copy pathTaskfile.yml
File metadata and controls
213 lines (175 loc) · 6.75 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
version: "3"
tasks:
# Test
# --------------------------------------------------------------------------------
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}}
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: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}}
# Coverage
# --------------------------------------------------------------------------------
coverage:check:
desc: Compare measured coverage against the baseline
cmd: python3 dev/scripts/coverage.py check
coverage:clean:
desc: Remove coverage results and reports
cmd: python3 dev/scripts/coverage.py clean
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:update:
desc: Updates the coverage baseline
cmd: python3 dev/scripts/coverage.py update
# 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:actions
- lint:csharp
- lint:markdown
- lint:python
- lint:rust
- lint:yaml
lint:actions:
desc: "Run GitHub Actions linting"
cmd: actionlint
lint:csharp:
desc: "Run C# linting"
env:
Configuration: Lint
cmds:
- dotnet format --verify-no-changes
# Shutdown build server to release file locks before lint build
- dotnet build-server shutdown
- dotnet build
lint:markdown:
desc: "Run Markdown linting"
cmd: npx --yes markdownlint-cli2 "**/*.md"
lint:python:
desc: "Run Python linting"
cmds:
- uvx ruff@latest check --config dev/conf/ruff.toml .
- uvx ruff@latest format --check --config dev/conf/ruff.toml .
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:yaml:
desc: "Run YAML linting"
cmd: npx --yes prettier --check "**/*.yml"
# Format
# --------------------------------------------------------------------------------
format:
desc: "Run all formatters"
deps:
- format:csharp
- format:markdown
- format:python
- format:rust
- format:yaml
format:csharp:
desc: "Run C# formatting"
env:
Configuration: Lint
cmd: dotnet format
format:markdown:
desc: "Run Markdown formatting"
cmd: npx --yes markdownlint-cli2 --fix "**/*.md"
format:python:
desc: "Run Python formatting"
cmd: uvx ruff@latest format --config dev/conf/ruff.toml .
format:rust:
desc: "Run Rust formatting"
dir: rust
cmd: cargo fmt --all
format:yaml:
desc: "Run YAML formatting"
cmd: npx --yes prettier --write --cache "**/*.yml"
# 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 dev/conf/lychee.toml .
check:todos:
desc: "Check that TODOs reference an open GitHub issue"
summary: |
Check that TODOs reference an open GitHub issue.
Options
--fail-issues ID [ID ...]
When provided, the script fails if any TODOs reference the specified GitHub issues.
Examples:
task check:todos
task check:todos -- --fail-issues 123 456
cmd: python3 dev/scripts/check_todos.py {{.CLI_ARGS}}