-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (47 loc) · 1.86 KB
/
dotnet-format-action.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
40
41
42
43
44
45
46
47
48
49
name: dotnet format
on:
push:
branches: [develop]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Run dotnet format
id: format
uses: jfversluis/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
action: "fix"
workspace: "./src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.sln"
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.Logger/EasyMicroservices.Logger.sln
- name: Test to generate Code Coverage Report
working-directory: ./src/CSharp/EasyMicroservices.Logger
run: |
dotnet build ./EasyMicroservices.Logger.sln
dotnet tool install --global coverlet.console
coverlet EasyMicroservices.Logger.Tests/bin/Debug/net6.0/EasyMicroservices.Logger.Tests.dll --target "dotnet" --targetargs "test EasyMicroservices.Logger.Tests/bin/Debug/net6.0/EasyMicroservices.Logger.Tests.dll --no-build" -f opencover
- name: OpenCover Badge Generator
uses: danpetitt/[email protected]
with:
path-to-opencover-xml: ./src/CSharp/EasyMicroservices.Logger/coverage.opencover.xml
path-to-badges: ./src/CSharp/EasyMicroservices.Logger
minimum-coverage: 50
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit files
if: steps.format.outputs.has-changes == 'true'
uses: EndBug/[email protected]
with:
author_name: Github Actions
author_email: [email protected]
message: "chore: Automated dotnet-format update"
ref: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}