-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (28 loc) · 1.05 KB
/
code-quality.yml
File metadata and controls
37 lines (28 loc) · 1.05 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
name: Code Quality
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Install .NET Format
run: dotnet tool install -g dotnet-format
- name: Check code formatting
run: dotnet format --verify-no-changes
- name: Install .NET Analyzers
run: |
dotnet add src/DotNetApiDiff/DotNetApiDiff.csproj package Microsoft.CodeAnalysis.NetAnalyzers
dotnet add src/DotNetApiDiff/DotNetApiDiff.csproj package StyleCop.Analyzers
dotnet add tests/DotNetApiDiff.Tests/DotNetApiDiff.Tests.csproj package Microsoft.CodeAnalysis.NetAnalyzers
- name: Run code analysis
run: dotnet build --no-restore /p:EnforceCodeStyleInBuild=true /p:EnableNETAnalyzers=true /p:AnalysisLevel=latest /p:TreatWarningsAsErrors=true