Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ on: [push]

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
VERBOSITY: q
CONFIGURATION: Release
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.306
dotnet-version: 8.0.406
#- name: Info
# run: dotnet --info
- name: Restore
Expand All @@ -36,23 +36,22 @@ jobs:

- name: Test Reporter
if: ${{ !env.ACT }}
uses: dorny/test-reporter@v1.6.0
uses: dorny/test-reporter@main
with:
name: Test Report
path: "./release/TestResults/*.trx"
reporter: dotnet-trx
path: "./release/TestResults/NMoneys.Tests.xml"
reporter: dotnet-nunit
fail-on-error: true

- name: Upload trx
uses: actions/upload-artifact@v3
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: tests-results
path: |
./release/TestResults/*.trx
./release/TestResults/*.xml

- name: Upload bin
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: bin
path: |
Expand All @@ -61,20 +60,20 @@ jobs:
./release/*.dll

- name: Upload packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packages
path: ./release/*.nupkg

- name: Upload Codecov coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ./release/TestResults/coverage.cobertura.xml
files: ./release/TestResults/NMoneys.Tests.cobertura.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

- name: Upload Coveralls coverage
uses: coverallsapp/github-action@v2
with:
files: ./release/TestResults/coverage.cobertura.xml
files: ./release/TestResults/NMoneys.Tests.cobertura.xml
format: cobertura
34 changes: 12 additions & 22 deletions scripts/NMoneys.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ task default -depends Clean, Restore, Compile, Test, Pack, CopyArtifacts

task Clean {
exec { & dotnet clean -c $configuration -v $verbosity --nologo $BASE_DIR }
# clear built packages
Join-Path $BASE_DIR src NMoneys bin $configuration |
Get-ChildItem |
Where-Object { $_.Name -match '.nupkg' } |
Remove-Item
# clear release folder
Remove-Item $RELEASE_DIR -Recurse -Force -ErrorAction SilentlyContinue | Out-Null
}

Expand All @@ -31,33 +37,17 @@ task Test {
$test_projects = @('NMoneys.Tests')
foreach ($test_project in $test_projects) {
$tests_dir = Join-Path $BASE_DIR tests $test_project
$trx = Join-Path TestResults "$test_project.trx"
$html = Join-Path TestResults "$test_project.html"
$test_results_dir = Join-Path $RELEASE_DIR TestResults
$runsettings_path = Join-Path $BASE_DIR tests .runsettings

exec {
& dotnet test --no-build -c $configuration --nologo -v $verbosity $tests_dir `
--results-directory $RELEASE_DIR `
--collect:"XPlat Code Coverage" `
-l:"console;verbosity=minimal;NoSummary=true" `
-l:"trx;LogFileName=$trx" `
-l:"html;LogFileName=$html" `
-- NUnit.TestOutputXml=TestResults NUnit.OutputXmlFolderMode=RelativeToResultDirectory
& dotnet run --no-build -c $configuration -v $verbosity --project $tests_dir -- `
--results-directory $test_results_dir `
--coverage --coverage-output-format cobertura --coverage-output "$test_project.cobertura.xml" `
--settings $runsettings_path
}
}

$test_results_dir = Join-Path $RELEASE_DIR TestResults
# copy coverage file to $RELEASE_DIR/TestResults
$RELEASE_DIR |
Get-ChildItem -exclude TestResults |
Get-ChildItem -Recurse |
Where-Object { $_.Name -match 'coverage.cobertura.xml' } |
Copy-Item -Destination $test_results_dir

# clean coverage directories
$RELEASE_DIR |
Get-ChildItem -Directory -Exclude 'TestResults' |
Remove-Item -Recurse

# TODO: generate extra HTML reports
}

Expand Down
5 changes: 3 additions & 2 deletions src/NMoneys/CurrencyIsoCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,15 @@ public enum CurrencyIsoCode : ushort
/// <summary>
/// Peso Convertible
/// </summary>
[CanonicalCulture("es-CU", Overwritten = true)]
[CanonicalCulture("es-CU", Overwritten = true), Obsolete("withdrawn of circulation")]
[Info(
englishName: "Peso Convertible", nativeName: "peso cubano convertible", symbol: "CUC$",
significantDecimalDigits: 2,
decimalSeparator: ".",
groupSeparator: ",", groupSizes: new byte[] { 3 },
positivePattern: 0, negativePattern: 1,
codePoint: 36, entityName: "dollar"
codePoint: 36, entityName: "dollar",
isObsolete: true
)]
CUC = 931,

Expand Down
8 changes: 4 additions & 4 deletions src/NMoneys/NMoneys.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</PropertyGroup>

<PropertyGroup>
<Version>7.3.0</Version>
<AssemblyVersion>7.3.0.0</AssemblyVersion>
<FileVersion>7.3.0.0</FileVersion>
<PackageVersion>7.3.0</PackageVersion>
<Version>7.4.0</Version>
<AssemblyVersion>7.4.0.0</AssemblyVersion>
<FileVersion>7.4.0.0</FileVersion>
<PackageVersion>7.4.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions tests/.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information, see https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019 -->

<RunSettings>
<RunConfiguration />
<NUnit>
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
<Verbosity>-1</Verbosity>
<DumpXmlTestResults>true</DumpXmlTestResults>
<ShowInternalProperties>false</ShowInternalProperties>
<TestOutputXml>TestOutputXml</TestOutputXml>
<OutputXmlFolderMode>UseResultDirectory</OutputXmlFolderMode>
</NUnit>
</RunSettings>
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,28 @@
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<EnableNUnitRunner>true</EnableNUnitRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>

<EnableStaticNativeInstrumentation>false</EnableStaticNativeInstrumentation>
<EnableDynamicNativeInstrumentation>false</EnableDynamicNativeInstrumentation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.15" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<!--PackageReference Include="MongoDB.Bson" Version="2.4.4" /-->
<PackageReference Include="MongoDB.Driver" Version="2.19.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.10.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageReference Include="Testing.Commons" Version="3.0.0.0" />
</ItemGroup>

Expand All @@ -28,6 +36,4 @@
<ProjectReference Include="..\..\src\NMoneys.Serialization\NMoneys.Serialization.csproj" />
</ItemGroup>



</Project>
21 changes: 12 additions & 9 deletions tests/NMoneys.Tests/NMoneys.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>

<EnableNUnitRunner>true</EnableNUnitRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>

<EnableStaticNativeInstrumentation>false</EnableStaticNativeInstrumentation>
<EnableDynamicNativeInstrumentation>false</EnableDynamicNativeInstrumentation>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.1.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.6.0" />
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageReference Include="Testing.Commons.NUnit" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NMoneys\NMoneys.csproj" />



</ItemGroup>


Expand Down
Loading