99 Build :
1010
1111 runs-on : ubuntu-latest
12- env :
13- VSTEST_CONNECTION_TIMEOUT : 900
12+ defaults :
13+ run :
14+ working-directory : ./src
1415
15- strategy :
16- matrix :
17- dotnet-version : [ 'netcoreapp3.1', 'net5', 'net6' ]
18-
19- steps :
20- - uses : actions/checkout@v2
21- - name : Setup .NET Core
22- uses : actions/setup-dotnet@v1
23- with :
24- dotnet-version : ' 3.1.x'
25- - name : Setup .NET Core
26- uses : actions/setup-dotnet@v1
27- with :
28- dotnet-version : ' 5.0.x'
29- - name : Setup .NET Core
30- uses : actions/setup-dotnet@v1
31- with :
32- dotnet-version : ' 6.0.x'
33- - name : Install dependencies
34- run : dotnet restore ./src/
35- - name : Build solution
36- run : dotnet build ./src/ --no-restore --framework ${{matrix.dotnet-version}}
37-
38- Test :
39- needs : build
40- runs-on : ubuntu-latest
4116 env :
4217 VSTEST_CONNECTION_TIMEOUT : 900
43-
44- strategy :
45- matrix :
46- dotnet-version : [ 'netcoreapp3.1', 'net5', 'net6' ]
4718
48- if : success()
4919 steps :
50- - uses : actions/checkout@v2
51- - name : Setup .NET Core
52- uses : actions/setup-dotnet@v1
53- with :
54- dotnet-version : ' 3.1.x'
55- - name : Setup .NET Core
56- uses : actions/setup-dotnet@v1
57- with :
58- dotnet-version : ' 5.0.x'
20+ - uses : actions/checkout@v2
5921 - name : Setup .NET Core
6022 uses : actions/setup-dotnet@v1
6123 with :
62- dotnet-version : ' 6.0.x'
24+ dotnet-version : |
25+ 3.1.x
26+ 5.0.x
27+ 6.0.x
6328 - name : Install dependencies
64- run : dotnet restore ./src/
65- - name : Test with dotnet
66- run : dotnet test ./src/ --framework ${{matrix.dotnet-version}} --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
67- - name : Upload dotnet test results
68- uses : actions/upload-artifact@v2
29+ run : dotnet restore
30+ - name : Build solution
31+ run : dotnet build -c Release --no-restore /p:Version=1.2.3.4
32+ - name : Test
33+ run : dotnet test -c Release --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../coverage/
34+ - uses : codecov/codecov-action@v2
6935 with :
70- name : dotnet-results- ${{ matrix.dotnet-version }}
71- path : TestResults-${{ matrix.dotnet-version }}
72- # Use always() to always run this step to publish test results when there are test failures
73- if : ${{ always() }}
36+ token : ${{ secrets.CODECOV_TOKEN }}
37+ directory : ../coverage/
38+ flags : unittests
39+
0 commit comments