Skip to content

Commit c4d9763

Browse files
Adding CI changes with code cov
1 parent 4abf3ac commit c4d9763

3 files changed

Lines changed: 26 additions & 52 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,31 @@ jobs:
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+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,6 @@ MigrationBackup/
348348

349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351+
352+
353+
*.opencover.xml

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
[![Build and Test](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml/badge.svg?branch=main)](https://github.com/GeoJSON-Net/GeoJSON.Text/actions/workflows/ci-build.yml)
2+
(http://img.shields.io/nuget/v/GeoJSON.Text.svg?style=flat)](https://www.nuget.org/packages/GeoJSON.Text/)
3+
[![codecov](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text/branch/main/graph/badge.svg?token=SE9XY1T8XO)](https://codecov.io/gh/GeoJSON-Net/GeoJSON.Text)
4+
5+
16
# GetJson.Text
27
.Net library for GeoJSON types & corresponding System.TExt.Json (de)serializers

0 commit comments

Comments
 (0)