chore: update project files and configurations for improved compatibility and performance

This commit is contained in:
Miha Kralj
2025-12-09 16:04:19 -05:00
parent c802a9ea80
commit 8959d9584d
10 changed files with 65 additions and 74 deletions
+1 -1
View File
@@ -19,4 +19,4 @@ query-filters:
- recommendation - recommendation
paths: paths:
- src - lib
+2 -12
View File
@@ -14,18 +14,8 @@ REM Also clean TestResults and .sonarqube
powershell -NoProfile -Command "Remove-Item -Path '%~dp0..\TestResults' -Recurse -Force -ErrorAction SilentlyContinue" powershell -NoProfile -Command "Remove-Item -Path '%~dp0..\TestResults' -Recurse -Force -ErrorAction SilentlyContinue"
powershell -NoProfile -Command "Remove-Item -Path '%~dp0..\.sonarqube' -Recurse -Force -ErrorAction SilentlyContinue" powershell -NoProfile -Command "Remove-Item -Path '%~dp0..\.sonarqube' -Recurse -Force -ErrorAction SilentlyContinue"
REM Convert script path to WSL format REM Convert script path to WSL format using PowerShell for reliable drive letter conversion
set "SCRIPT_PATH=%~dp0scanner.sh" for /f "usebackq delims=" %%P in (`powershell -NoProfile -Command "$p='%~dp0scanner.sh'; $d=$p.Substring(0,1).ToLower(); '/mnt/' + $d + $p.Substring(2).Replace('\','/')"` ) do set "SCRIPT_PATH=%%P"
set "SCRIPT_PATH=%SCRIPT_PATH:\=/%"
REM Convert any drive letter (C:, D:, Z:, etc.) to /mnt/x format
for /f "tokens=1 delims=:" %%d in ("%SCRIPT_PATH%") do (
set "DRIVE_LETTER=%%d"
)
call set "SCRIPT_PATH=%%SCRIPT_PATH:%DRIVE_LETTER%:=/mnt/%DRIVE_LETTER%%%"
REM Convert drive letter to lowercase
for %%l in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (
call set "SCRIPT_PATH=%%SCRIPT_PATH:/mnt/%%l=/mnt/%%l%%"
)
REM Run scanner with tokens passed via environment (as root for tool access) REM Run scanner with tokens passed via environment (as root for tool access)
wsl -d Debian -u root -- env SONAR_TOKEN="%SONAR_TOKEN%" CODACY_PROJECT_TOKEN="%CODACY_PROJECT_TOKEN%" QODANA_TOKEN="%QODANA_TOKEN%" bash "%SCRIPT_PATH%" %* wsl -d Debian -u root -- env SONAR_TOKEN="%SONAR_TOKEN%" CODACY_PROJECT_TOKEN="%CODACY_PROJECT_TOKEN%" QODANA_TOKEN="%QODANA_TOKEN%" bash "%SCRIPT_PATH%" %*
+7 -3
View File
@@ -125,7 +125,7 @@ if [ "$SKIP_BUILD" = false ]; then
# Copy coverage files to Qodana directory and convert Windows paths to Linux # Copy coverage files to Qodana directory and convert Windows paths to Linux
log_info "Copying coverage files for Qodana..." log_info "Copying coverage files for Qodana..."
index=0 index=0
find . -name "coverage.info" -type f | while read -r file; do while read -r file; do
# Convert Windows paths (Z:\github\...) to Linux paths (/mnt/z/github/...) # Convert Windows paths (Z:\github\...) to Linux paths (/mnt/z/github/...)
sed -e 's|SF:Z:\\|SF:/mnt/z/|g' \ sed -e 's|SF:Z:\\|SF:/mnt/z/|g' \
-e 's|SF:z:\\|SF:/mnt/z/|g' \ -e 's|SF:z:\\|SF:/mnt/z/|g' \
@@ -133,7 +133,7 @@ if [ "$SKIP_BUILD" = false ]; then
"$file" > "$COVERAGE_DIR/coverage_$index.info" "$file" > "$COVERAGE_DIR/coverage_$index.info"
log_detail "Converted: $file -> coverage_$index.info (Windows→Linux paths)" log_detail "Converted: $file -> coverage_$index.info (Windows→Linux paths)"
((index++)) || true ((index++)) || true
done done < <(find . -name "coverage.info" -type f)
fi fi
# ============================================ # ============================================
@@ -203,7 +203,11 @@ if [ "$SKIP_QODANA" = false ]; then
# Install dependencies required for Qodana (IntelliJ) on minimal Debian # Install dependencies required for Qodana (IntelliJ) on minimal Debian
if ! dpkg -s libfreetype6 fontconfig &> /dev/null; then if ! dpkg -s libfreetype6 fontconfig &> /dev/null; then
log_info "Installing missing dependencies (libfreetype6, fontconfig)..." log_info "Installing missing dependencies (libfreetype6, fontconfig)..."
apt-get update && apt-get install -y libfreetype6 fontconfig if [ "$EUID" -ne 0 ]; then
sudo apt-get update && sudo apt-get install -y libfreetype6 fontconfig
else
apt-get update && apt-get install -y libfreetype6 fontconfig
fi
fi fi
export CI=true export CI=true
+10 -15
View File
@@ -17,32 +17,27 @@ fi
# Coverage output directory for Qodana # Coverage output directory for Qodana
COVERAGE_DIR=".qodana/code-coverage" COVERAGE_DIR=".qodana/code-coverage"
echo "==> Building solution..."
dotnet build --no-incremental
echo "==> Running tests with coverage..."
mkdir -p "$COVERAGE_DIR"
dotnet test --no-build --collect:"XPlat Code Coverage" \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov
# Copy coverage to Qodana directory
find . -name "coverage.info" -exec cp {} "$COVERAGE_DIR/" \;
# Run SonarCloud # Run SonarCloud
echo "==> Starting SonarScanner analysis..." echo "==> Starting SonarScanner analysis..."
# Re-run tests with OpenCover format for SonarCloud
dotnet test --no-build --collect:"XPlat Code Coverage" \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
dotnet sonarscanner begin \ dotnet sonarscanner begin \
/o:"mihakralj-quantalib" \ /o:"mihakralj-quantalib" \
/k:"mihakralj_QuanTAlib" \ /k:"mihakralj_QuanTAlib" \
/d:sonar.token="$SONAR_TOKEN" \ /d:sonar.token="$SONAR_TOKEN" \
/d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
echo "==> Building solution..."
dotnet build --no-incremental dotnet build --no-incremental
echo "==> Running tests with coverage..."
mkdir -p "$COVERAGE_DIR"
# Run tests with both formats if possible, or sequentially
dotnet test --no-build --collect:"XPlat Code Coverage" \
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=lcov,opencover
# Copy coverage to Qodana directory
find . -name "coverage.info" -exec cp {} "$COVERAGE_DIR/" \;
dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"
echo "==> SonarCloud: https://sonarcloud.io/project/overview?id=mihakralj_QuanTAlib" echo "==> SonarCloud: https://sonarcloud.io/project/overview?id=mihakralj_QuanTAlib"
+6 -4
View File
@@ -71,14 +71,14 @@ jobs:
run: | run: |
mkdir -p coverage mkdir -p coverage
count=1 count=1
find . -name "coverage.opencover.xml" -type f | while read file; do while read -r file; do
dest="coverage/coverage_${count}.opencover.xml" dest="coverage/coverage_${count}.opencover.xml"
cp "$file" "$dest" cp "$file" "$dest"
# Sanitize paths for Qodana (convert absolute to relative) # Sanitize paths for Qodana (convert absolute to relative)
# This strips the current working directory from the paths in the XML # This strips the current working directory from the paths in the XML
sed -i "s|$(pwd)/||g" "$dest" sed -i "s|$(pwd)/||g" "$dest"
count=$((count+1)) count=$((count+1))
done done < <(find . -name "coverage.opencover.xml" -type f)
- name: Upload Coverage Artifacts - name: Upload Coverage Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@@ -315,8 +315,10 @@ jobs:
needs: [Build_Test_Coverage, Sonar_Analysis, Qodana_Scan, Codecov_Upload, Codacy_Upload, Snyk_Scan, CodeQL_Analysis] needs: [Build_Test_Coverage, Sonar_Analysis, Qodana_Scan, Codecov_Upload, Codacy_Upload, Snyk_Scan, CodeQL_Analysis]
if: | if: |
success() && success() &&
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || endsWith(github.ref, '-dev'))) || (
github.event_name == 'workflow_dispatch' (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || endsWith(github.ref, '-dev'))) ||
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
+3 -3
View File
@@ -45,7 +45,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<NoWarn>S1144,S1944,S2053,S2222,S2245,S2259,S2583,S2589,S3329,S3655,S3776,S3900,S3949,S3966,S4158,S4347,S5773,S6781</NoWarn> <NoWarn>$(NoWarn);S1144;S1944;S2053;S2222;S2245;S2259;S2583;S2589;S3329;S3655;S3776;S3900;S3949;S3966;S4158;S4347;S5773;S6781</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -53,8 +53,8 @@
</ItemGroup> </ItemGroup>
<PropertyGroup Condition="'$(IsLocalBuild)' == 'true' AND $([MSBuild]::IsOSPlatform('Windows'))"> <PropertyGroup Condition="'$(IsLocalBuild)' == 'true' AND $([MSBuild]::IsOSPlatform('Windows'))">
<QuantowerRoot>Z:\Quantower</QuantowerRoot> <QuantowerRoot Condition="'$(QuantowerRoot)' == ''">Z:\Quantower</QuantowerRoot>
<QuantowerPath>$([System.IO.Directory]::GetDirectories("$(QuantowerRoot)\TradingPlatform", "v1*")[0])</QuantowerPath> <QuantowerPath Condition="Exists('$(QuantowerRoot)\TradingPlatform')">$([System.IO.Directory]::GetDirectories("$(QuantowerRoot)\TradingPlatform", "v1*")[0])</QuantowerPath>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
+2 -2
View File
@@ -12,12 +12,12 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" /> <PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Skender.Stock.Indicators" Version="2.7.0" /> <PackageReference Include="Skender.Stock.Indicators" Version="2.7.0" />
<PackageReference Include="TALib.NETCore" Version="0.5.0" /> <PackageReference Include="TALib.NETCore" Version="0.5.0" />
<PackageReference Include="Tulip.NETCore" Version="0.8.0.1" /> <PackageReference Include="Tulip.NETCore" Version="0.8.0.1" />
<PackageReference Include="xunit" Version="2.9.3" /> <PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" /> <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net10.0</TargetFrameworks> <TargetFramework>net10.0</TargetFramework>
<Title>QuanTAlib</Title> <Title>QuanTAlib</Title>
<Product>Library of TA Calculations, Charts and Strategies for Quantower</Product> <Product>Library of TA Calculations, Charts and Strategies for Quantower</Product>
<Description>Quantitative Technical Analysis Library in C# for Quantower</Description> <Description>Quantitative Technical Analysis Library in C# for Quantower</Description>
+1 -1
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<AssemblyName>Trends</AssemblyName> <AssemblyName>Trends</AssemblyName>
<AlgoType>Indicator</AlgoType> <AlgoType>Indicator</AlgoType>
<OutputPath>bin\$(Configuration)\</OutputPath> <OutputPath>bin\$(Configuration)\</OutputPath>