From 1d29e882cc5924e046713f95dfe72f4ad1c960b7 Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Mon, 15 Jun 2026 10:48:54 +0200 Subject: [PATCH 1/6] chore: modernize 4 packages to net8.0, EF Core 8, SourceLink, CI/CD/Sonar Co-Authored-By: Claude Sonnet 4.6 --- .gitattributes | 1 + .github/workflows/ci.yml | 38 +++++++++++++ .github/workflows/publish.yml | 42 +++++++++++++++ .github/workflows/sonar.yml | 54 +++++++++++++++++++ README.md | 24 +++++++-- Stocks.Data.Ado/Stocks.Data.Ado.csproj | 44 ++++++++------- Stocks.Data.Common/Stocks.Data.Common.csproj | 7 +-- Stocks.Data.Ef/Stocks.Data.Ef.csproj | 42 ++++++++------- .../Stocks.Data.Infrastructure.csproj | 44 +++++++-------- Stocks.Data.Model/Stocks.Data.Model.csproj | 37 +++++++------ Stocks.Data.UnitTests.Ef/StockContextTest.cs | 1 - .../Stocks.Data.UnitTests.Ef.csproj | 32 ++++------- .../Stocks.Data.UnitTests.Common.csproj | 21 ++++---- .../Stocks.Data.UnitTests.Model.csproj | 20 ++++--- 14 files changed, 277 insertions(+), 130 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/sonar.yml diff --git a/.gitattributes b/.gitattributes index 1ff0c42..5b65514 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ # Set default behavior to automatically normalize line endings. ############################################################################### * text=auto +*.yml text eol=lf ############################################################################### # Set default behavior for command prompt diff. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c343b97 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0.x + - name: Restore + run: | + dotnet restore Stocks.Data.Model/Stocks.Data.Model.csproj + dotnet restore Stocks.Data.Common/Stocks.Data.Common.csproj + dotnet restore Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj + dotnet restore Stocks.Data.Ef/Stocks.Data.Ef.csproj + dotnet restore Stocks.Data.Ado/Stocks.Data.Ado.csproj + dotnet restore Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj + dotnet restore Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj + dotnet restore Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj + - name: Build + run: | + dotnet build Stocks.Data.Model/Stocks.Data.Model.csproj --no-restore + dotnet build Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj --no-restore + dotnet build Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-restore + dotnet build Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-restore + - name: Test + run: | + dotnet test Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj --no-build --verbosity normal + dotnet test Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj --no-build --verbosity normal + dotnet test Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj --no-build --verbosity normal diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..c2dfe30 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,42 @@ +name: Publish + +on: + push: + tags: + - 'v*' + +permissions: + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0.x + - name: Restore and Build + run: | + dotnet restore Stocks.Data.Model/Stocks.Data.Model.csproj + dotnet restore Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj + dotnet restore Stocks.Data.Ef/Stocks.Data.Ef.csproj + dotnet restore Stocks.Data.Ado/Stocks.Data.Ado.csproj + dotnet build Stocks.Data.Model/Stocks.Data.Model.csproj --no-restore -c Release + dotnet build Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj --no-restore -c Release + dotnet build Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-restore -c Release + dotnet build Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-restore -c Release + - name: Pack + run: | + dotnet pack Stocks.Data.Model/Stocks.Data.Model.csproj --no-build -c Release -o nupkgs + dotnet pack Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj --no-build -c Release -o nupkgs + dotnet pack Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-build -c Release -o nupkgs + dotnet pack Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-build -c Release -o nupkgs + - name: Login to NuGet + uses: NuGet/login@v1 + with: + usernameVar: NUGET_USER + tokenVar: NUGET_TOKEN + - name: Push to NuGet + run: dotnet nuget push nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..e56ac9b --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,54 @@ +name: SonarCloud + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + sonar: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0.x + - name: Setup Java (required by SonarScanner) + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + - name: Install dotnet-sonarscanner + run: dotnet tool install --global dotnet-sonarscanner + - name: Install dotnet-coverage + run: dotnet tool install --global dotnet-coverage + - name: SonarCloud begin + run: | + dotnet sonarscanner begin \ + /k:"PFalkowski_StocksData" \ + /o:"pfalkowski" \ + /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ + /d:sonar.host.url="https://sonarcloud.io" \ + /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml + - name: Build + run: | + dotnet build Stocks.Data.Model/Stocks.Data.Model.csproj --no-incremental + dotnet build Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj --no-incremental + dotnet build Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-incremental + dotnet build Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-incremental + - name: Collect coverage + run: | + dotnet-coverage collect "dotnet test Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj --no-build" -f xml -o coverage_model.xml + dotnet-coverage collect "dotnet test Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj --no-build" -f xml -o coverage_ef.xml + dotnet-coverage merge coverage_model.xml coverage_ef.xml -f xml -o coverage.xml + - name: SonarCloud end + run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" diff --git a/README.md b/README.md index 4a49f3c..214f7bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,24 @@ -# Stocks.Data.TradingSimulator - -A .NET Standard 2.1 library for simulating stock trading strategies using historical market data. +# StocksData + +[![CI](https://github.com/PFalkowski/StocksData/actions/workflows/ci.yml/badge.svg)](https://github.com/PFalkowski/StocksData/actions/workflows/ci.yml) +[![NuGet (Model)](https://img.shields.io/nuget/v/Stocks.Data.Model.svg?label=Model)](https://www.nuget.org/packages/Stocks.Data.Model/) +[![NuGet (Infrastructure)](https://img.shields.io/nuget/v/Stocks.Data.Infrastructure.svg?label=Infrastructure)](https://www.nuget.org/packages/Stocks.Data.Infrastructure/) +[![NuGet (Ef)](https://img.shields.io/nuget/v/Stocks.Data.Ef.svg?label=Ef)](https://www.nuget.org/packages/Stocks.Data.Ef/) +[![NuGet (Ado)](https://img.shields.io/nuget/v/Stocks.Data.Ado.svg?label=Ado)](https://www.nuget.org/packages/Stocks.Data.Ado/) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=PFalkowski_StocksData&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=PFalkowski_StocksData) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://choosealicense.com/licenses/mit/) +[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-support-yellow.svg)](https://www.buymeacoffee.com/piotrfalkowski) + +A collection of .NET 8 libraries for working with stock market data (OHLCV format). + +## Packages + +| Package | Description | +|---------|-------------| +| `Stocks.Data.Model` | Domain model: `StockQuote`, `Company`, `TradingSimulationResult` | +| `Stocks.Data.Infrastructure` | CSV import helpers, OnTheFlyStats aggregation | +| `Stocks.Data.Ef` | EF Core repositories and Unit of Work for stock data | +| `Stocks.Data.Ado` | SQL Server bulk-insert via `SqlBulkCopy` | ## Features diff --git a/Stocks.Data.Ado/Stocks.Data.Ado.csproj b/Stocks.Data.Ado/Stocks.Data.Ado.csproj index c59e4a7..f3bc653 100644 --- a/Stocks.Data.Ado/Stocks.Data.Ado.csproj +++ b/Stocks.Data.Ado/Stocks.Data.Ado.csproj @@ -1,41 +1,39 @@ - + - netstandard2.1 - Debug;Release;Pack + net8.0 + latest Piotr Falkowski - - Piotr Falkowski © 2020 - - 2.0.0 + Bulk insert using SqlBulkCopy for StockQuotes in daily format. + Piotr Falkowski © 2026 + MIT https://github.com/PFalkowski/StocksData https://github.com/PFalkowski/StocksData git bulk-insert, stock-quote - initial release - bulk insert using SqlBulkCopy for StockQuotes in daily format. - true - MIT + 2.1.0 + true + $(NoWarn);CS1591 + README.md + true + true + true + snupkg - - true - - - + - - - - + - - - + + + + + diff --git a/Stocks.Data.Common/Stocks.Data.Common.csproj b/Stocks.Data.Common/Stocks.Data.Common.csproj index 0e1bf77..a9fb460 100644 --- a/Stocks.Data.Common/Stocks.Data.Common.csproj +++ b/Stocks.Data.Common/Stocks.Data.Common.csproj @@ -1,13 +1,14 @@ - netstandard2.1 + net8.0 + latest - - + + diff --git a/Stocks.Data.Ef/Stocks.Data.Ef.csproj b/Stocks.Data.Ef/Stocks.Data.Ef.csproj index e280b65..4e3a678 100644 --- a/Stocks.Data.Ef/Stocks.Data.Ef.csproj +++ b/Stocks.Data.Ef/Stocks.Data.Ef.csproj @@ -1,37 +1,39 @@ - + - netstandard2.1 - true - Piotr Falkowski © 2020 - + net8.0 + latest + Piotr Falkowski + Persistence layer for stocks using Entity Framework Core. + Piotr Falkowski © 2026 + MIT https://github.com/PFalkowski/StocksData https://github.com/PFalkowski/StocksData git Stock, Data, EntityFrameworkCore, UnitOfWork, Repository - Persistance layer for stocks using Entity Framework Core. .NET Standard 2.0 - Change namespaces - Piotr Falkowski - 3.0.0 - Debug;Release;Pack - MIT - - - - true + 3.1.0 + true + $(NoWarn);CS1591 + README.md + true + true + true + snupkg - + - - + - - + + + + + diff --git a/Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj b/Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj index c8dca89..5e9a25e 100644 --- a/Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj +++ b/Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj @@ -1,38 +1,40 @@ - + - netstandard2.1 - true - Infrastracture for persistance of stock quotes in daily format (open, high, low, close) and import from CSV files in .NET Standard 2.1 + net8.0 + latest + Piotr Falkowski + Infrastructure for persistence of stock quotes in daily format (open, high, low, close) and import from CSV files. + Piotr Falkowski © 2026 + MIT https://github.com/PFalkowski/StocksData https://github.com/PFalkowski/StocksData - Piotr Falkowski © 2020 - - Stock, Data, Csv - fix bugs git - Piotr Falkowski - 3.0.0 - Debug;Release;Pack - MIT - - - - true + Stock, Data, Csv + 3.1.0 + true + $(NoWarn);CS1591 + README.md + true + true + true + snupkg - + - - + + + + + - - + diff --git a/Stocks.Data.Model/Stocks.Data.Model.csproj b/Stocks.Data.Model/Stocks.Data.Model.csproj index 256eacd..0414d8a 100644 --- a/Stocks.Data.Model/Stocks.Data.Model.csproj +++ b/Stocks.Data.Model/Stocks.Data.Model.csproj @@ -1,29 +1,34 @@ - + - netstandard2.1 - true - Model for persistance of stock quotes in daily format (open, high, low, close) .NET Standard 2.0 - Piotr Falkowski © 2020 - + net8.0 + latest + Piotr Falkowski + Model for persistence of stock quotes in daily format (open, high, low, close). + Piotr Falkowski © 2026 + MIT https://github.com/PFalkowski/StocksData https://github.com/PFalkowski/StocksData git Stocks, Data, Model, EntityFrameworkCore - fix bugs - Piotr Falkowski - Debug;Release;Pack - 3.0.0 - MIT + 3.1.0 + true + $(NoWarn);CS1591 + README.md + true + true + true + snupkg - - true - + + + + + - - + diff --git a/Stocks.Data.UnitTests.Ef/StockContextTest.cs b/Stocks.Data.UnitTests.Ef/StockContextTest.cs index 8d1632b..c377e8b 100644 --- a/Stocks.Data.UnitTests.Ef/StockContextTest.cs +++ b/Stocks.Data.UnitTests.Ef/StockContextTest.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollector.InProcDataCollector; using Stocks.Data.UnitTests.Ef.Test.TestData; using Stocks.Data.Model; using Xunit; diff --git a/Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj b/Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj index df3263b..54c0e83 100644 --- a/Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj +++ b/Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj @@ -1,29 +1,27 @@ - netcoreapp3.1 - + net8.0 false - Stocks.Data.UnitTests.Ef.Test - Stocks.Data.UnitTests.Ef.Test - - Debug;Release;Pack - - - + + + - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + all - runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -31,12 +29,6 @@ - - - System - - - True @@ -52,6 +44,4 @@ - - diff --git a/Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj b/Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj index c1f17f5..445f0a2 100644 --- a/Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj +++ b/Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj @@ -1,24 +1,23 @@ - netcoreapp3.1 - + net8.0 false - Stocks.Data.Common.Test - - Debug;Release;Pack - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + all - runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj b/Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj index 7aa73c0..bf9ab96 100644 --- a/Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj +++ b/Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj @@ -1,25 +1,23 @@ - netcoreapp3.1 - + net8.0 false - Stocks.Data.UnitTests.Model - Stocks.Data.UnitTests.Model - - Debug;Release;Pack - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + all - runtime; build; native; contentfiles; analyzers + runtime; build; native; contentfiles; analyzers; buildtransitive - From cfa97b91d19bf9308d3322265c4d532659472e31 Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Mon, 15 Jun 2026 14:27:05 +0200 Subject: [PATCH 2/6] docs: add install snippet to README --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 214f7bc..d1d0ceb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# StocksData +# StocksData [![CI](https://github.com/PFalkowski/StocksData/actions/workflows/ci.yml/badge.svg)](https://github.com/PFalkowski/StocksData/actions/workflows/ci.yml) [![NuGet (Model)](https://img.shields.io/nuget/v/Stocks.Data.Model.svg?label=Model)](https://www.nuget.org/packages/Stocks.Data.Model/) @@ -11,6 +11,15 @@ A collection of .NET 8 libraries for working with stock market data (OHLCV format). +## Install + +```bash +dotnet add package Stocks.Data.Model +dotnet add package Stocks.Data.Infrastructure +dotnet add package Stocks.Data.Ef +dotnet add package Stocks.Data.Ado +``` + ## Packages | Package | Description | From c74e6e474135866f2673ad90fabef5f0b73c28ce Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Mon, 15 Jun 2026 23:33:08 +0200 Subject: [PATCH 3/6] fix(ci): pin GitHub Actions to full commit SHAs (supply-chain hardening) Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish.yml | 6 +++--- .github/workflows/sonar.yml | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c343b97..2e078e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - name: Setup .NET - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5 with: dotnet-version: 8.0.x - name: Restore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c2dfe30..f08d6d0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,9 +12,9 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 - name: Setup .NET - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5 with: dotnet-version: 8.0.x - name: Restore and Build @@ -34,7 +34,7 @@ jobs: dotnet pack Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-build -c Release -o nupkgs dotnet pack Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-build -c Release -o nupkgs - name: Login to NuGet - uses: NuGet/login@v1 + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1 with: usernameVar: NUGET_USER tokenVar: NUGET_TOKEN diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index e56ac9b..7a160a0 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -10,20 +10,20 @@ jobs: sonar: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v5 + uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5 with: dotnet-version: 8.0.x - name: Setup Java (required by SonarScanner) - uses: actions/setup-java@v4 + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 with: distribution: temurin java-version: 21 - name: Cache SonarCloud packages - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar From 3a566ef29eee99bc5a776336ffd874c1fa5482bb Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Mon, 15 Jun 2026 23:37:01 +0200 Subject: [PATCH 4/6] fix(ci): use SONAR_TOKEN env var instead of inline secret expansion Avoids the SonarCloud 'Avoid expanding secrets in a run block' hotspot. The secret is already mapped to the env var on each step. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/sonar.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 7a160a0..fe12bd0 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -36,7 +36,7 @@ jobs: dotnet sonarscanner begin \ /k:"PFalkowski_StocksData" \ /o:"pfalkowski" \ - /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ + /d:sonar.token="$SONAR_TOKEN" \ /d:sonar.host.url="https://sonarcloud.io" \ /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml - name: Build @@ -51,4 +51,4 @@ jobs: dotnet-coverage collect "dotnet test Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj --no-build" -f xml -o coverage_ef.xml dotnet-coverage merge coverage_model.xml coverage_ef.xml -f xml -o coverage.xml - name: SonarCloud end - run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" From cc212843d0d08e6d44ae655828126308f494f854 Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Mon, 15 Jun 2026 23:45:18 +0200 Subject: [PATCH 5/6] fix(ci): correctly wire SONAR_TOKEN secret to env block Previously the sed replacement incorrectly changed the env mapping line (SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}) to a bare var reference, or the env block was missing entirely. The scanner received an empty/literal token and authentication failed. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/sonar.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index fe12bd0..ac86802 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -32,6 +32,8 @@ jobs: - name: Install dotnet-coverage run: dotnet tool install --global dotnet-coverage - name: SonarCloud begin + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | dotnet sonarscanner begin \ /k:"PFalkowski_StocksData" \ @@ -51,4 +53,6 @@ jobs: dotnet-coverage collect "dotnet test Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj --no-build" -f xml -o coverage_ef.xml dotnet-coverage merge coverage_model.xml coverage_ef.xml -f xml -o coverage.xml - name: SonarCloud end + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" From 547a638601165f208a229703a696273babc1f66b Mon Sep 17 00:00:00 2001 From: PFalkowski Date: Tue, 16 Jun 2026 14:17:28 +0200 Subject: [PATCH 6/6] fix: build test projects before dotnet test --no-build Source-project-only build left test DLLs absent; VSTest failed with "argument is invalid". Build test projects transitively instead. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e078e8..3fee52f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,9 @@ jobs: dotnet restore Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj - name: Build run: | - dotnet build Stocks.Data.Model/Stocks.Data.Model.csproj --no-restore - dotnet build Stocks.Data.Infrastructure/Stocks.Data.Infrastructure.csproj --no-restore - dotnet build Stocks.Data.Ef/Stocks.Data.Ef.csproj --no-restore - dotnet build Stocks.Data.Ado/Stocks.Data.Ado.csproj --no-restore + dotnet build Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj --no-restore + dotnet build Stocks.Data.UnitTests.Infrastructure/Stocks.Data.UnitTests.Common.csproj --no-restore + dotnet build Stocks.Data.UnitTests.Ef/Stocks.Data.UnitTests.Ef.csproj --no-restore - name: Test run: | dotnet test Stocks.Data.UnitTests.Model/Stocks.Data.UnitTests.Model.csproj --no-build --verbosity normal