From 26f1485f95cd74f36457de95077f1d8e4e4f0615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Garc=C3=ADa?= Date: Sun, 16 Feb 2025 13:56:49 +0100 Subject: [PATCH 1/5] deprecated CUC as per amendment 178 --- src/NMoneys/CurrencyIsoCode.cs | 5 +++-- src/NMoneys/NMoneys.csproj | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/NMoneys/CurrencyIsoCode.cs b/src/NMoneys/CurrencyIsoCode.cs index 3b40be3..25e0133 100644 --- a/src/NMoneys/CurrencyIsoCode.cs +++ b/src/NMoneys/CurrencyIsoCode.cs @@ -523,14 +523,15 @@ public enum CurrencyIsoCode : ushort /// /// Peso Convertible /// - [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, diff --git a/src/NMoneys/NMoneys.csproj b/src/NMoneys/NMoneys.csproj index 682a688..03453a4 100644 --- a/src/NMoneys/NMoneys.csproj +++ b/src/NMoneys/NMoneys.csproj @@ -31,10 +31,10 @@ - 7.3.0 - 7.3.0.0 - 7.3.0.0 - 7.3.0 + 7.4.0 + 7.4.0.0 + 7.4.0.0 + 7.4.0 From 03a569aaba0c455934106beef654897916c913cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 10:30:26 +0100 Subject: [PATCH 2/5] use Microsoft Testing Platform (refactoring scripts) --- scripts/NMoneys.build.ps1 | 7 +++++- tests/.runsettings | 14 +++++++++++ .../NMoneys.Serialization.Tests.csproj | 24 ++++++++++++------- tests/NMoneys.Tests/NMoneys.Tests.csproj | 21 +++++++++------- 4 files changed, 47 insertions(+), 19 deletions(-) create mode 100644 tests/.runsettings diff --git a/scripts/NMoneys.build.ps1 b/scripts/NMoneys.build.ps1 index cc2f28d..292b05f 100644 --- a/scripts/NMoneys.build.ps1 +++ b/scripts/NMoneys.build.ps1 @@ -35,13 +35,18 @@ task Test { $html = Join-Path TestResults "$test_project.html" exec { - & dotnet test --no-build -c $configuration --nologo -v $verbosity $tests_dir ` + & dotnet run --no-build -c $configuration -v $verbosity --project $tests_dir -- ` + --results-directory $RELEASE_DIR ` + --coverage --coverage-output-format cobertura --coverage-output "$test_project.coverage.cobertura.xml" ` + --settings ./tests/.runsettings + <# & 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 + #> } } diff --git a/tests/.runsettings b/tests/.runsettings new file mode 100644 index 0000000..e98d476 --- /dev/null +++ b/tests/.runsettings @@ -0,0 +1,14 @@ + + + + + + + -1 + -1 + true + false + TestOutputXml + UseResultDirectory + + diff --git a/tests/NMoneys.Serialization.Tests/NMoneys.Serialization.Tests.csproj b/tests/NMoneys.Serialization.Tests/NMoneys.Serialization.Tests.csproj index 8ca225d..ea764f8 100644 --- a/tests/NMoneys.Serialization.Tests/NMoneys.Serialization.Tests.csproj +++ b/tests/NMoneys.Serialization.Tests/NMoneys.Serialization.Tests.csproj @@ -6,20 +6,28 @@ enable false - true + true + Exe + true + + false + false - + - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + @@ -28,6 +36,4 @@ - - diff --git a/tests/NMoneys.Tests/NMoneys.Tests.csproj b/tests/NMoneys.Tests/NMoneys.Tests.csproj index f5ccdd1..888ddcf 100644 --- a/tests/NMoneys.Tests/NMoneys.Tests.csproj +++ b/tests/NMoneys.Tests/NMoneys.Tests.csproj @@ -6,23 +6,26 @@ enable false - true + + true + Exe + true + + false + false - - - - - + + + + + - - - From a51357783e482809bf161c3b78848f8ade495ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 14:17:24 +0100 Subject: [PATCH 3/5] finished adapting local build to MTP --- scripts/NMoneys.build.ps1 | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/scripts/NMoneys.build.ps1 b/scripts/NMoneys.build.ps1 index 292b05f..b78ce4b 100644 --- a/scripts/NMoneys.build.ps1 +++ b/scripts/NMoneys.build.ps1 @@ -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 } @@ -31,38 +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 run --no-build -c $configuration -v $verbosity --project $tests_dir -- ` - --results-directory $RELEASE_DIR ` - --coverage --coverage-output-format cobertura --coverage-output "$test_project.coverage.cobertura.xml" ` - --settings ./tests/.runsettings - <# & 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 - #> + --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 } From 0c18d5f2d78c4c346e4a283e044f4fda34b82ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 14:37:54 +0100 Subject: [PATCH 4/5] make changes to github actions due to MTF --- .github/workflows/build.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdba683..04a34bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 env: VERBOSITY: q CONFIGURATION: Release @@ -12,10 +12,10 @@ jobs: 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 @@ -36,23 +36,22 @@ jobs: - name: Test Reporter if: ${{ !env.ACT }} - uses: dorny/test-reporter@v1.6.0 + uses: dorny/test-reporter@v1.9.1 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: | @@ -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 From ccb0ac4d1fb515d08afd7f931cb8378f883c320a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez=20Garc=C3=ADa?= Date: Mon, 24 Feb 2025 14:42:54 +0100 Subject: [PATCH 5/5] use unreleased version to support nunit format --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04a34bc..3d37618 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Test Reporter if: ${{ !env.ACT }} - uses: dorny/test-reporter@v1.9.1 + uses: dorny/test-reporter@main with: name: Test Report path: "./release/TestResults/NMoneys.Tests.xml"