Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 61 additions & 6 deletions .github/workflows/ci-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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/')
Expand Down
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
Loading