Repository navigation
76 lines (63 loc) · 2.08 KB
/
Copy pathautoformat-code.yml
File metadata and controls
76 lines (63 loc) · 2.08 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
73
74
75
76
name: Autoformat code
on:
push:
branches:
- main
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
dotnet-format-core-lint:
# Name the Job
name: Clean up C# code base via dotnet-format
# Set the type of machine to run on
runs-on: ubuntu-latest
env:
working-directory : ./
strategy:
matrix:
solution:
- Zilon.Core
fail-fast: false
steps:
- uses: actions/checkout@v3
- run: git pull
- run: dotnet tool install --global dotnet-format --version 5.0.211103
- name: Format codebase ${{ matrix.solution }}
run: dotnet-format Zilon.Core/${{ matrix.solution }}.sln --fix-whitespace --fix-style --verbosity detailed
working-directory: ${{env.working-directory}}
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
message: "[Bot] Automated dotnet-format update"
add: "*.cs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Set the job key. The key is displayed as the job name
# when a job name is not provided
resharper-core-lint:
# Name the Job
name: Clean up C# code base via R# CLT
# Set the type of machine to run on
runs-on: ubuntu-latest
env:
working-directory : ./Zilon.Core/
needs: [dotnet-format-core-lint]
steps:
- uses: actions/checkout@v3
- run: git pull
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Setup ReSharper Command Line Tools
run: dotnet tool install --global JetBrains.ReSharper.GlobalTools --version 2022.2.3
- name: Clean up codebase via ReSharper Command Line Tools
run: jb cleanupcode --profile="Full Cleanup" Zilon.Core.sln
working-directory: ${{env.working-directory}}
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
message: "[Bot] Automated ReSharper CLT update"
add: "*.cs"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}