-
Notifications
You must be signed in to change notification settings - Fork 55
70 lines (57 loc) · 1.85 KB
/
developer-cli.yml
File metadata and controls
70 lines (57 loc) · 1.85 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
name: Developer CLI
on:
push:
branches:
- main
paths:
- "developer-cli/**"
- ".github/workflows/developer-cli.yml"
- "!**.md"
pull_request:
paths:
- "developer-cli/**"
- ".github/workflows/developer-cli.yml"
- "!**.md"
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-verify:
name: Build, Lint, and Format
runs-on: ubuntu-24.04
env:
# Skip the CLI's self-rebuild on every invocation; we build explicitly below.
DEVELOPERCLI_SKIP_CHANGE_DETECTION: "1"
steps:
- name: Checkout Code
uses: actions/checkout@v6
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: developer-cli/global.json
- name: Restore .NET Tools
working-directory: developer-cli
run: dotnet tool restore
- name: Restore .NET Dependencies
working-directory: developer-cli
run: dotnet restore
- name: Build Developer CLI
working-directory: developer-cli
run: dotnet build DeveloperCli.slnx --no-restore
- name: Run Code Linting
working-directory: developer-cli
run: |
dotnet run --no-build -- lint --cli --no-build | tee lint-output.log
if ! grep -q "No developer-cli issues found!" lint-output.log; then
echo "Code linting issues found."
exit 1
fi
- name: Check for Code Formatting Issues
working-directory: developer-cli
run: |
dotnet run --no-build -- format --cli --no-build
# Check for any changes made by the code formatter
git diff --exit-code || {
echo "Formatting issues detected. Please run 'dotnet run -- format --cli' from /developer-cli folder locally and commit the formatted code."
exit 1
}