forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 1.09 KB
/
lint-check-dotnet.yml
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
name: Dotnet Lint and Check
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
dotnetcheck:
name: Lint DotNet
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
8.0.x
- name: Checkout files
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
dotnetv3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275
with:
files: "dotnetv3/**/*.{cs,sln,csproj,json}"
- name: Build check
if: steps.changed-files.outputs.any_changed == 'true'
run: |
cd dotnetv3
dotnet build -v=q --property WarningLevel=0 /clp:ErrorsOnly
- name: Lint and format check
if: steps.changed-files.outputs.any_changed == 'true' && (success() || failure())
run: |
cd dotnetv3
dotnet format --verify-no-changes