Skip to content

Commit ad1b452

Browse files
authored
INumber<T> Support (#10)
* Basic INumber implementation * NumericOption core tests * Basic math tests * More operator tests * Decided against NumericResult in favor of result.OkNumber() * Generic zero and one * Explicit interface implementation for INumberBase members that don't make sense in the public API * Because System.Math doesn't support generic numbers, making some useful INumberBase methods public * Adding useful public static methods: Min/Max/Clamp * Code coverage in CI * Code coverage report * Switching to opencover * Configuring codecov paths * fixes for path from Windows build * Parsing tests * Additional parsing tests * INumber method test coverage * INumber method tests * Avoiding duplicate codecov uploads * Parsing tests * Parsing coverage * Create checked/saturating/truncating with tests * Improving code coverage
1 parent 0cd5f0b commit ad1b452

20 files changed

+2957
-524
lines changed

.github/workflows/build-and-test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build and test
1+
name: CI
22

33
on:
44
push:
@@ -13,25 +13,31 @@ env:
1313

1414
jobs:
1515
build-and-test:
16-
1716
name: build-and-test-${{matrix.os}}
1817
runs-on: ${{ matrix.os }}
1918
strategy:
2019
matrix:
2120
os: [ubuntu-latest, windows-latest, macOS-latest]
21+
defaults:
22+
run:
23+
working-directory: src
2224

2325
steps:
2426
- uses: actions/checkout@v3
25-
- name: Setup .NET Core
27+
- name: Setup .NET
2628
uses: actions/setup-dotnet@v3
2729
with:
2830
dotnet-version: ${{ env.DOTNET_VERSION }}
2931

3032
- name: Install dependencies
31-
run: dotnet restore src
33+
run: dotnet restore
3234

3335
- name: Build
34-
run: dotnet build --configuration Release --no-restore src
36+
run: dotnet build --no-restore --configuration Release
3537

3638
- name: Test
37-
run: dotnet test --no-restore --verbosity normal src
39+
run: dotnet test --no-restore --verbosity normal -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover
40+
41+
- name: Upload coverage reports to Codecov
42+
uses: codecov/codecov-action@v3
43+
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request' }}

0 commit comments

Comments
 (0)