Skip to content

Commit

Permalink
Add code coverage via Codecov (#2)
Browse files Browse the repository at this point in the history
Fix a few nits in CI and scripts. Add Codecov badge to README
  • Loading branch information
nietras authored May 26, 2023
1 parent 0d4e968 commit 4b4eb03
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: dotnet

on:
push:
branches: [ "master" ]
branches: [ "main" ]
pull_request:
branches: [ "master" ]
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
Expand All @@ -26,4 +27,8 @@ jobs:
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test -c ${{ matrix.configuration }} --no-build --verbosity normal
run: dotnet test -c ${{ matrix.configuration }} --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.os }},${{ matrix.configuration }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sep - Possibly the World's Fastest .NET CSV Parser
[![Build Status](https://github.com/nietras/Sep/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/nietras/Sep/actions/workflows/dotnet.yml) [![NuGet](https://img.shields.io/nuget/v/Sep.svg)](https://www.nuget.org/packages/Sep/)
[![Build Status](https://github.com/nietras/Sep/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/nietras/Sep/actions/workflows/dotnet.yml) [![codecov](https://codecov.io/gh/nietras/Sep/branch/main/graph/badge.svg?token=WN56CR3X0D)](https://codecov.io/gh/nietras/Sep) [![NuGet](https://img.shields.io/nuget/v/Sep.svg)](https://www.nuget.org/packages/Sep/)

Modern, minimal, fast, zero allocation, reading and writing of separated values
(`csv`, `tsv` etc.). Cross-platform, trimmable and AOT/NativeAOT compatible.
Expand Down
1 change: 1 addition & 0 deletions Sep.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{32021D88-4
pack.ps1 = pack.ps1
publish-tester.ps1 = publish-tester.ps1
README.md = README.md
rename.ps1 = rename.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sep.Tester", "src\Sep.Tester\Sep.Tester.csproj", "{28D41891-53C4-4FE9-8ED4-A8880E766E16}"
Expand Down
2 changes: 1 addition & 1 deletion rename.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$oldName = "OLD"
$newName = "NEW"
Get-ChildItem -Filter "*$oldName*" -Recurse | Rename-Item -NewName {$_.name -replace $oldName, $newName }
Get-ChildItem -Recurse -Include "*.sln","*.cs","*.xaml","*.xml","*.csproj","*.xproj","*.json","*.md","*.cmd","*.props","*.txt" |
Get-ChildItem -Recurse -Include "*.sln","*.cs","*.xaml","*.xml","*.csproj","*.xproj","*.json","*.md","*.cmd","*.props","*.txt","*.yml" |
ForEach-Object { $a = $_.fullname; ( [System.IO.File]::ReadAllText($a) ) | % {
If ($_.Contains($oldName))
{
Expand Down
2 changes: 1 addition & 1 deletion test-x64-x86.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dotnet test --nologo -c Release -- RunConfiguration.TargetPlatform=x86 /Parallel
Write-Host "Testing Debug X64"
dotnet test --nologo -c Debug -- RunConfiguration.TargetPlatform=x64 /Parallel
Write-Host "Testing Release X64"
dotnet test --nologo -c Release -- RunConfiguration.TargetPlatform=x64 /Parallel
dotnet test --nologo -c Release --collect:"XPlat Code Coverage" -- RunConfiguration.TargetPlatform=x64 /Parallel

0 comments on commit 4b4eb03

Please sign in to comment.