Skip to content

Commit 67ee748

Browse files
authored
Merge pull request #8 from AdamWyatt34/sprint9
Sprint9
2 parents 47d5814 + d430eb0 commit 67ee748

32 files changed

+4071
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "nuget"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build and Test (${{ matrix.os }})
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
fail-fast: false
17+
runs-on: ${{ matrix.os }}
18+
timeout-minutes: 15
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: 8.0.x
30+
31+
- name: Cache NuGet packages
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.nuget/packages
35+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
36+
restore-keys: |
37+
${{ runner.os }}-nuget-
38+
39+
- name: Restore dependencies
40+
run: dotnet restore
41+
42+
- name: Build
43+
run: dotnet build --no-restore --configuration Release
44+
45+
- name: Run tests with coverage
46+
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings --logger "trx;LogFileName=test-results.trx"
47+
48+
- name: Upload test results
49+
if: always()
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: test-results-${{ matrix.os }}
53+
path: '**/test-results.trx'
54+
retention-days: 7
55+
56+
# Coverage steps - only on Ubuntu to avoid duplicates
57+
- name: Generate coverage report
58+
if: matrix.os == 'ubuntu-latest'
59+
run: |
60+
dotnet tool install -g dotnet-reportgenerator-globaltool
61+
reportgenerator -reports:**/coverage.cobertura.xml -targetdir:coveragereport -reporttypes:Html
62+
63+
- name: Upload coverage report
64+
if: matrix.os == 'ubuntu-latest'
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: coverage-report
68+
path: coveragereport
69+
retention-days: 30
70+
71+
- name: Upload coverage to Codecov
72+
if: matrix.os == 'ubuntu-latest'
73+
uses: codecov/codecov-action@v4
74+
with:
75+
files: '**/coverage.cobertura.xml'
76+
flags: unittests
77+
name: codecov-pdk
78+
fail_ci_if_error: false
79+
verbose: true
80+
81+
- name: Pack as dotnet tool
82+
if: matrix.os == 'ubuntu-latest'
83+
run: dotnet pack src/PDK.CLI/PDK.CLI.csproj --no-build --configuration Release --output ./artifacts
84+
85+
- name: List package contents
86+
if: matrix.os == 'ubuntu-latest'
87+
shell: bash
88+
run: |
89+
if [ -f ./artifacts/*.nupkg ]; then
90+
echo "Package created successfully"
91+
ls -lh ./artifacts/
92+
else
93+
echo "Error: Package not found"
94+
exit 1
95+
fi
96+
97+
- name: Upload package
98+
if: matrix.os == 'ubuntu-latest'
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: nuget-package
102+
path: ./artifacts/*.nupkg
103+
retention-days: 7

.github/workflows/dogfood.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Dogfood
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
inputs:
10+
compare_with_ci:
11+
description: 'Compare with latest CI run'
12+
type: boolean
13+
default: false
14+
schedule:
15+
# Weekly on Sundays at midnight UTC - catch environmental drift
16+
- cron: '0 0 * * 0'
17+
18+
jobs:
19+
dogfood-ubuntu:
20+
name: PDK Self-Test (Ubuntu)
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 20
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup .NET
31+
uses: actions/setup-dotnet@v4
32+
with:
33+
dotnet-version: 8.0.x
34+
35+
- name: Make scripts executable
36+
run: chmod +x scripts/*.sh
37+
38+
- name: Run Environment Check
39+
run: ./scripts/check-environment.sh
40+
41+
- name: Build PDK
42+
run: dotnet build --configuration Release
43+
44+
- name: Run PDK Self-Test
45+
run: ./scripts/self-test.sh
46+
47+
- name: Upload Dogfood Results
48+
if: always()
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: dogfood-results-ubuntu
52+
path: .pdk-dogfood/
53+
retention-days: 7
54+
55+
- name: Compare with CI (optional)
56+
if: github.event.inputs.compare_with_ci == 'true'
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
run: ./scripts/compare-outputs.sh
60+
61+
dogfood-windows:
62+
name: PDK Self-Test (Windows)
63+
runs-on: windows-latest
64+
timeout-minutes: 20
65+
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v4
69+
with:
70+
fetch-depth: 0
71+
72+
- name: Setup .NET
73+
uses: actions/setup-dotnet@v4
74+
with:
75+
dotnet-version: 8.0.x
76+
77+
- name: Run Environment Check
78+
run: ./scripts/check-environment.ps1
79+
shell: pwsh
80+
81+
- name: Build PDK
82+
run: dotnet build --configuration Release
83+
84+
- name: Run PDK Self-Test
85+
run: ./scripts/self-test.ps1
86+
shell: pwsh
87+
88+
- name: Upload Dogfood Results
89+
if: always()
90+
uses: actions/upload-artifact@v3
91+
with:
92+
name: dogfood-results-windows
93+
path: .pdk-dogfood/
94+
retention-days: 7
95+
96+
dogfood-macos:
97+
name: PDK Self-Test (macOS)
98+
runs-on: macos-latest
99+
timeout-minutes: 20
100+
101+
steps:
102+
- name: Checkout code
103+
uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
107+
- name: Setup .NET
108+
uses: actions/setup-dotnet@v4
109+
with:
110+
dotnet-version: 8.0.x
111+
112+
- name: Install Docker
113+
run: |
114+
brew install docker
115+
# Note: Docker Desktop required for full Docker support on macOS
116+
# This step installs docker CLI only
117+
118+
- name: Make scripts executable
119+
run: chmod +x scripts/*.sh
120+
121+
- name: Run Environment Check
122+
run: ./scripts/check-environment.sh
123+
continue-on-error: true # Docker may not be fully available
124+
125+
- name: Build PDK
126+
run: dotnet build --configuration Release
127+
128+
- name: Run PDK Self-Test (Host Mode)
129+
run: |
130+
# On macOS CI, Docker is not available by default
131+
# Run with --host flag if Docker check fails
132+
if docker info &> /dev/null; then
133+
./scripts/self-test.sh
134+
else
135+
echo "Docker not available, skipping container-based self-test"
136+
echo "Building and testing directly..."
137+
dotnet test --configuration Release --verbosity normal
138+
fi
139+
140+
- name: Upload Dogfood Results
141+
if: always()
142+
uses: actions/upload-artifact@v3
143+
with:
144+
name: dogfood-results-macos
145+
path: .pdk-dogfood/
146+
retention-days: 7
147+
if-no-files-found: ignore

0 commit comments

Comments
 (0)