-
-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (81 loc) · 3.12 KB
/
ci.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: ci
on:
push:
tags:
- v*
branches: [main]
pull_request:
branches: [main, feature/*]
jobs:
build:
env:
APP: "${{ github.workspace }}/app"
PROJECT_TEST: "${{ github.workspace }}/app/Spinner.Test"
PROJECT_SLN: "./app/Spinner.sln"
PROJECT_BIN3_1: "./app/Spinner/bin/Release/netcoreapp3.1"
PROJECT_BIN5: "./app/Spinner/bin/Release/net5.0"
PROJECT_BIN6: "./app/Spinner/bin/Release/net6.0"
PROJECT_BIN7: "./app/Spinner/bin/Release/net7.0"
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["7.0.305"]
steps:
- uses: actions/checkout@v2
- name: Get Build Version 🏷️
run: |
Import-Module .\nupkgs\GetBuildVersion.psm1
Write-Host $Env:GITHUB_REF
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Setup NuGet 🔧
uses: NuGet/setup-nuget@v1.0.5
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} 🔧
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Setup Stryker 🔧
run: dotnet tool install -g dotnet-stryker
- name: Install dotnet-format tool 🔧
run: dotnet tool install -g dotnet-format
- name: Clean Dependencies 📦
run: dotnet clean ${{env.PROJECT_SLN }}
- name: Restore Dependencies 📦
run: dotnet restore ${{env.PROJECT_SLN }}
- name: Build ⚙️
run: dotnet build ${{env.PROJECT_SLN }} -c Release -p:Version=$BUILD_VERSION --no-restore
- name: Format ♻️
run: dotnet format ${{env.APP }} -v diag --severity error --no-restore
- name: Test 🧪
run: dotnet test ${{env.PROJECT_SLN }} --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Mutant Test 🧪👾
if: github.event_name == 'pull_request'
run: |
cd ${{ env.PROJECT_TEST}}
dotnet stryker --reporter "progress"
- name: Run Infer .Net 3.1 🔍
uses: microsoft/infersharpaction@v1.2
with:
binary-path: ${{ env.PROJECT_BIN3_1 }}
- name: Run Infer .Net 5.0 🔍
uses: microsoft/infersharpaction@v1.2
with:
binary-path: ${{ env.PROJECT_BIN5 }}
- name: Run Infer .Net 6.0 🔍
uses: microsoft/infersharpaction@v1.2
with:
binary-path: ${{ env.PROJECT_BIN6 }}
- name: Run Infer .Net 7.0 🔍
uses: microsoft/infersharpaction@v1.2
with:
binary-path: ${{ env.PROJECT_BIN7 }}
- name: Codecov 📊
uses: codecov/codecov-action@v2.1.0
with:
token: ${{secrets.CODECOV_TOKEN}}
directory: ${{ env.PROJECT_TEST }}
file: coverage.opencover.xml
- name: Publish Package ✉️
if: startsWith(github.ref, 'refs/tags/v')
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_TOKEN}}