-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (56 loc) · 2.53 KB
/
Copy pathvalidate-task.yml
File metadata and controls
72 lines (56 loc) · 2.53 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
name: Validate task
# The single validation gate: unit tests plus the full lint set (the editor's checks enforced in CI from
# the same config files). Reused by test-pull-request (which produces the required status check) and by
# publish-release (whose publish job needs it), so the PR gate and the publish gate run the identical
# validation from one definition, and nothing publishes that would fail the PR.
on:
workflow_call:
jobs:
unit-test:
name: Run unit tests job
runs-on: ubuntu-latest
steps:
- name: Setup .NET SDK step
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
with:
dotnet-version: 10.x
- name: Checkout code step
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Builds with TreatWarningsAsErrors, so analyzer and code-style warnings fail here.
- name: Run unit tests step
run: dotnet test
# The same checks the editor runs interactively, enforced in CI from the same config files: CSharpier
# formatting, dotnet format style (EditorConfig), markdownlint, cspell on the user-facing docs, and
# actionlint (which shellchecks every run: block).
lint:
name: Lint job
runs-on: ubuntu-latest
steps:
- name: Setup .NET SDK step
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
with:
dotnet-version: 10.x
- name: Checkout code step
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check C# formatting step
run: |
set -euo pipefail
dotnet tool restore
dotnet csharpier check .
- name: Check C# style step
run: dotnet format style --verify-no-changes --severity=info --verbosity=detailed
- name: Lint markdown step
uses: DavidAnson/markdownlint-cli2-action@ded1f9488f68a970bc66ea5619e13e9b52e601cd # v23.2.0
with:
globs: '**/*.md'
# Spell check the user-facing docs. The word list and exclusions live in cspell.json, shared with the
# editor's Code Spell Checker.
- name: Spell check step
uses: streetsidesoftware/cspell-action@de2a73e963e7443969755b648a1008f77033c5b2 # v8.4.0
with:
files: |
README.md
HISTORY.md
incremental_files_only: false
- name: Lint workflows step
uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0