diff --git a/.github/workflows/ci-build-test.yml b/.github/workflows/ci-build-test.yml index e85adfb..0c56c93 100644 --- a/.github/workflows/ci-build-test.yml +++ b/.github/workflows/ci-build-test.yml @@ -57,7 +57,8 @@ jobs: --logger "trx;LogFileName=test-results.trx" \ --results-directory TestResults \ --collect:"XPlat Code Coverage" \ - --verbosity normal + --verbosity normal \ + --framework net8.0 - name: Run TAF Tests run: | @@ -67,7 +68,8 @@ jobs: --logger "trx;LogFileName=test-results-taf.trx" \ --results-directory TestResults \ --collect:"XPlat Code Coverage" \ - --verbosity normal + --verbosity normal \ + --framework net8.0 - name: Upload Test Results uses: actions/upload-artifact@v4 @@ -87,11 +89,64 @@ jobs: path: TestResults/**/coverage.* retention-days: 7 + # Build and Test on Windows (.NET Framework) + build-windows: + name: Build Metar Decoder (Windows) + runs-on: windows-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Cache NuGet Packages + uses: actions/cache@v5 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore Dependencies + run: | + echo "Restoring NuGet packages for MetarDecoder.sln" + dotnet restore MetarDecoder.sln --no-cache --force --verbosity normal + + - name: Build Solution + run: | + echo "Building MetarDecoder.sln" + dotnet build MetarDecoder.sln --no-restore --configuration Release --verbosity minimal + + - name: Run .NET Framework Tests + run: | + echo "Running tests for .NET Framework 4.8" + dotnet test tests/Metar.Decoder.Tests/ --configuration Release --logger "trx;LogFileName=test-results-net48.trx" --results-directory TestResults --framework net48 --verbosity normal + + - name: Run TAF .NET Framework Tests + run: | + echo "Running TAF tests for .NET Framework 4.8" + dotnet test tests/Taf.Decoder.Tests/ --configuration Release --logger "trx;LogFileName=test-results-taf-net48.trx" --results-directory TestResults --framework net48 --verbosity normal + + - name: Upload Windows Test Results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results-windows + path: | + TestResults/**/*.trx + retention-days: 7 + # Security & Quality Checks security: name: 🔒 Security & Quality runs-on: ubuntu-latest - needs: [build-metar] + needs: [build-metar, build-windows] steps: - name: 📥 Checkout Code @@ -100,7 +155,7 @@ jobs: - name: 🔍 Security Scan (Metar Decoder) run: | echo "🔒 Running security scan on metar-decoder" - dotnet list package --vulnerable --include-prerelease + dotnet list MetarDecoder.sln package --vulnerable - name: 📊 Code Quality Analysis run: | @@ -133,7 +188,7 @@ jobs: coverage-reports: name: 📊 Coverage Reports runs-on: ubuntu-latest - needs: [build-metar] + needs: [build-metar, build-windows] if: always() steps: @@ -196,7 +251,7 @@ jobs: create-pr: name: 🔄 Create PR to main runs-on: ubuntu-latest - needs: [build-metar, security, coverage-reports] + needs: [build-metar, build-windows, security, coverage-reports] if: | github.event_name == 'push' && startsWith(github.ref, 'refs/heads/feature/') || startsWith(github.ref, 'refs/heads/bug/') || startsWith(github.ref, 'refs/heads/hotfix/') diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e7202ae --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/tests/Taf.Decoder.Tests/bin/Debug/net10.0/Taf.Decoder.Tests.dll", + "args": [], + "cwd": "${workspaceFolder}/tests/Taf.Decoder.Tests", + // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..8570650 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/MetarDecoder.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/MetarDecoder.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/MetarDecoder.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file