forked from archlens/ArchLens
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.83 KB
/
dotnet.yml
File metadata and controls
64 lines (53 loc) · 1.83 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
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
lint:
name: Lint
if: github.event_name == 'pull_request' || github.event_name == 'draft'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore src/c-sharp/Archlens.sln
- name: Remove unused imports
run: >
dotnet format style src/c-sharp/Archlens.sln --severity warn --no-restore --verbosity diagnostic --exclude "src/ArchlensTests/TestRepo"
# To exclude files or folders, append e.g.:
# --exclude "src/c-sharp/SomeFolder/**/*.cs"
# --exclude "src/c-sharp/SomeFolder/**"
# To ignore specific lines of code, wrap it in e.g. #pragma warning disable IDE0005
- name: Commit fixes (if any)
run: |
git diff --quiet && echo "Nothing to fix." && exit 0
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore: remove unused imports"
git push
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore src/c-sharp/Archlens.sln
- name: Build
run: dotnet build src/c-sharp/Archlens.sln --no-restore
- name: Test
run: dotnet test src/c-sharp/Archlens.sln --no-build --verbosity normal