From 68d15402ad115484195b2a85aca6863f7b222599 Mon Sep 17 00:00:00 2001 From: just Date: Sun, 13 Sep 2026 17:38:25 +0400 Subject: [PATCH] workflow setup --- .gitea/workflows/test-dotnet.yaml | 58 +++++++++++++++++++ .../DoubleDoubleTests.cs | 16 +++++ README.md | 28 +++++++-- 3 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 .gitea/workflows/test-dotnet.yaml create mode 100644 1-tests/Just.PreciseMath.Tests/DoubleDoubleTests.cs diff --git a/.gitea/workflows/test-dotnet.yaml b/.gitea/workflows/test-dotnet.yaml new file mode 100644 index 0000000..f57fdf3 --- /dev/null +++ b/.gitea/workflows/test-dotnet.yaml @@ -0,0 +1,58 @@ +name: .NET Test + +on: + push: + branches: [ main ] + tags-ignore: + - '**' + paths-ignore: + - 'README.md' + - 'LICENSE' + - '.vscode/**' + - '.gitea/workflows/publish-*.yaml' + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + name: .NET tests + permissions: + contents: read + actions: write + + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 'true' + + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + - name: Restore dependencies + run: dotnet restore --disable-parallel + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Test + run: >- + dotnet test --configuration Release --no-build --verbosity normal + --minimum-expected-tests 1 + --report-xunit-trx --coverlet --coverlet-output-format cobertura + --coverlet-include "[Just.PreciseMath]*" + + - name: Upload test and coverage results + uses: actions/upload-artifact@v3 + if: ${{ always() }} + with: + name: test-results + path: | + 1-tests/**/TestResults/**/*.trx + 1-tests/**/TestResults/**/*cobertura*.xml + retention-days: 3 diff --git a/1-tests/Just.PreciseMath.Tests/DoubleDoubleTests.cs b/1-tests/Just.PreciseMath.Tests/DoubleDoubleTests.cs new file mode 100644 index 0000000..ac4fa90 --- /dev/null +++ b/1-tests/Just.PreciseMath.Tests/DoubleDoubleTests.cs @@ -0,0 +1,16 @@ +using Shouldly; +using Xunit; + +namespace Just.PreciseMath.Tests; + +public class DoubleDoubleTests +{ + [Fact] + public void OneHasExpectedComponents() + { + DoubleDouble value = DoubleDouble.One; + + value.High.ShouldBe(1.0); + value.Low.ShouldBe(0.0); + } +} diff --git a/README.md b/README.md index b33b66a..cd7d17f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Just.PreciseMath -**WIP — repository scaffolding only; no library implementation or tests yet.** +**WIP — initial library implementation and one smoke test; numerical correctness is not yet validated.** A .NET 10 library being developed for extended-precision floating-point arithmetic using double-double representations (a high/low pair of `double` values), with @@ -42,11 +42,27 @@ dotnet test --solution Just.PreciseMath.slnx -c Release --no-build dotnet format Just.PreciseMath.slnx --verify-no-changes --no-restore ``` -The empty test project currently reports no tests (MTP exit code 8); this is not a -passing test suite. Once tests exist, add `--coverlet` to the test command for -coverage. The benchmark project deliberately builds as a library without source -files; add an entry point and benchmark cases, then change `OutputType` to `Exe` -and run it in Release without a debugger. No performance results exist yet. +The initial smoke test checks that `DoubleDouble.One` exposes high and low +components of `1.0` and `0.0`. It exercises the test/coverage pipeline, not the +numerical accuracy of the planned library. + +CI collects TRX test results and Cobertura coverage for `Just.PreciseMath` only, +excluding test dependencies, and requires at least one test. The `test-results` +artifact contains TRX test results and timestamped Cobertura XML coverage reports, +retained for three days. +Open the workflow run in Gitea Actions and download that artifact. Upload is +attempted even when tests fail; no badges or repository-write token are needed. + +To generate the same reports locally: + +```sh +dotnet test --solution Just.PreciseMath.slnx -c Release --no-build --minimum-expected-tests 1 --report-xunit-trx --coverlet --coverlet-output-format cobertura --coverlet-include "[Just.PreciseMath]*" +``` + +Reports are written under each test project's `bin/Release/net10.0/TestResults/`. +The benchmark project deliberately builds as a library without source files; +add an entry point and benchmark cases, then change `OutputType` to `Exe` and run +it in Release without a debugger. No performance results exist yet. Package metadata uses the development version `0.1.0-dev`. Licensed under the [MIT License](LICENSE), included in the package.