Skip to content

Commit f09bf0c

Browse files
Feature/ci cd modernization (#47)
* feat: modernize CI/CD pipeline infrastructure ✨ Phase 1: Infrastructure Modernization Complete ## 🚀 New Features - **Modern CI/CD Pipeline**: Consolidated 3 separate OS workflows into unified matrix-based ci.yml - **Automated GitHub Packages**: Daily development builds for immediate testing feedback - **Enhanced Security**: CodeQL analysis + Dependabot automation - **GitHub Test Reporter**: Native test result visualization (replaces Testspace) ## 🔄 Workflow Changes - ✅ **ci.yml**: Cross-platform matrix testing (Windows/Linux/macOS) with modern actions - ✅ **publish-dev-github.yml**: Automated GitHub Packages publishing for development - ✅ **publish-nuget.yml**: Enhanced manual workflow supporting both GitHub Packages & NuGet.org - ✅ **security.yml**: CodeQL security scanning + dependency review - ✅ **dependabot.yml**: Automated dependency management with smart grouping ## 🏗️ Infrastructure Updates - **GitHub Actions**: Updated to v4 (checkout, setup-dotnet, cache, upload-artifact) - **Runners**: Migrated from ubuntu-20.04 to ubuntu-latest - **Test Reporting**: Native GitHub integration via dorny/test-reporter@v1 - **Package Caching**: Optimized NuGet package caching for faster builds - **Build System**: Added GitHub Packages support to Cake Frosting build ## 🗑️ Removed Deprecated Components - ❌ **Old Workflows**: build-ubuntu.yml, build-windows.yml, build-macos.yml - ❌ **Testspace**: External test reporting service dependency - ❌ **Old Actions**: checkout@v2, setup-dotnet@v1, [email protected] ## 📦 Release Strategy - **Development**: Auto-publish to GitHub Packages on every master/v2-preview1 commit - **Preview/Stable**: Manual NuGet.org publishing with enhanced dropdown workflow - **Version Format**: 2.0.0-preview1.20240715.a1b2c3d for development builds Ready for Phase 2: Enhanced automation & community features! 🎯 * docs: update README with modernized CI/CD information ✨ Enhanced Documentation ## 📖 Updated Content - **CI/CD Badges**: Modern GitHub Actions workflow status badges - **Package Installation**: Dual-source strategy (NuGet.org + GitHub Packages) - **Development Builds**: Instructions for GitHub Packages authentication - **CI Status**: Matrix testing status across Windows/Linux/macOS ## 🔄 Badge Updates - ✅ **CI/CD Pipeline**: Cross-platform matrix testing status - ✅ **Security Analysis**: CodeQL scanning and dependency review - ✅ **Automated Publishing**: GitHub Packages development builds - ❌ **Removed**: Deprecated Testspace badge Ready for community testing with development packages! 🚀 * refactor: improve CI/CD trigger strategy following best practices 🔧 **Workflow Trigger Improvements** ## ✅ **Removed Hard-coded Feature Branches** - **CI Pipeline**: Only master branch + PRs (no temporary feature branches) - **Auto Publishing**: Only master branch (stable development builds) - **Manual Publishing**: Available from any branch when needed ## 🎯 **Benefits** - **Maintainable**: No need to update workflows for every feature branch - **Scalable**: Works for any future feature branches automatically - **Clean**: CI only runs at integration points (master + PRs) - **Efficient**: Eliminates duplicate workflow runs ## 🚀 **Result** - ✅ Follows GitHub Actions best practices - ✅ Reduced maintenance overhead - ✅ Clean separation of concerns - ✅ Ready for production use CI/CD modernization is now production-ready! 🎉 * feat: leverage built-in Mono runtime for cross-platform .NET Framework support 🎯 **Mono Runtime Modernization** ## 📰 **Context**: Microsoft Mono Project Transition - Original Mono Project → Moving to WineHQ stewardship - Microsoft's modern Mono fork → Integrated into dotnet/runtime - .NET 8+ includes built-in Mono runtime for cross-platform .NET Framework support ## ✅ **Cross-Platform .NET Framework Support** - **Linux**: Now runs net472 tests using built-in Mono runtime - **macOS**: Unified test execution (no more custom XUnit/Mono logic) - **Windows**: Unchanged (native .NET Framework support) ## 🔧 **Build System Improvements** - **Simplified Logic**: Removed platform-specific workarounds - **Unified Execution**: Same \`dotnet test\` command across all platforms - **Dependency Elimination**: No external Mono installation required - **Better Coverage**: Full framework testing on all platforms ## 🚀 **CI/CD Enhancements** - **Matrix Testing**: Added net472 to Linux/macOS matrix - **Trigger Fix**: Added feature/* pattern for testing - **Modern Runtime**: Leverages .NET 9.0.200 built-in Mono ## 📈 **Result** - ✅ True cross-platform .NET Framework support - ✅ Simplified, maintainable build system - ✅ Zero external runtime dependencies - ✅ Enhanced test coverage across all platforms * feat: add Mono installation support for .NET Framework testing on Linux * feat: add NUGET_PACKAGES environment variable to CI/CD workflows refactor: remove redundant NuGet package installation in InitTask * feat: update CI/CD workflows to use Ubuntu 22.04 and remove deprecated security analysis workflow * feat: update NUGET_PACKAGES path for cross-platform compatibility and add security analysis workflow * feat: update test execution condition for Linux and change dependency review runner to Ubuntu 22.04 * feat: remove security analysis workflow from CI/CD pipeline * feat: add dependency review workflow for pull requests
1 parent c1522fb commit f09bf0c

File tree

13 files changed

+571
-242
lines changed

13 files changed

+571
-242
lines changed

.github/workflows/build-macos.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/build-ubuntu.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/build-windows.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "CI/CD Pipeline"
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- "**.md"
7+
- LICENSE
8+
branches:
9+
- "master"
10+
pull_request:
11+
paths-ignore:
12+
- "**.md"
13+
- LICENSE
14+
branches:
15+
- master
16+
- "feature/*"
17+
18+
env:
19+
DOTNET_CLI_TELEMETRY_OPTOUT: true
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
21+
DOTNET_NOLOGO: true
22+
23+
jobs:
24+
build-and-test:
25+
name: "Build & Test (${{ matrix.name }})"
26+
runs-on: ${{ matrix.os }}
27+
env:
28+
NUGET_PACKAGES: ${{ contains(matrix.os, 'windows') && format('{0}\.nuget\packages', github.workspace) || format('{0}/.nuget/packages', github.workspace) }}
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- os: windows-latest
35+
name: "Windows"
36+
script: "./build.ps1"
37+
38+
- os: ubuntu-22.04
39+
name: "Linux"
40+
script: "./build.sh"
41+
42+
- os: macos-latest
43+
name: "macOS"
44+
script: "./build.sh"
45+
46+
steps:
47+
- name: "Checkout"
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0 # Full history for better caching
51+
52+
- name: "Setup .NET SDK"
53+
uses: actions/setup-dotnet@v4
54+
with:
55+
dotnet-version: |
56+
8.0.x
57+
9.0.x
58+
59+
- name: "Make build script executable"
60+
if: runner.os != 'Windows'
61+
run: chmod +x ./build.sh
62+
63+
- name: "Cache NuGet packages"
64+
uses: actions/cache@v4
65+
with:
66+
path: ${{ runner.os == 'Windows' && format('{0}\.nuget\packages', github.workspace) || format('{0}/.nuget/packages', github.workspace) }}
67+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json', '**/*.csproj', '**/Directory.Packages.props') }}
68+
restore-keys: |
69+
${{ runner.os }}-nuget-
70+
71+
- name: "Build"
72+
run: ${{ matrix.script }} --target build
73+
74+
- name: "Run Tests"
75+
run: ${{ matrix.script }} --target tests --skipFunctionalTest ${{ runner.os == 'Linux' && 'false' || 'true' }} --exclusive
76+
77+
- name: "Publish Test Results"
78+
uses: dorny/test-reporter@v1
79+
if: success() || failure()
80+
with:
81+
name: 'Test Results (${{ matrix.name }})'
82+
path: '**/TestResults/*.trx'
83+
reporter: 'dotnet-trx'
84+
fail-on-error: true
85+
max-annotations: 50
86+
87+
- name: "Upload Test Artifacts"
88+
uses: actions/upload-artifact@v4
89+
if: failure()
90+
with:
91+
name: test-results-${{ matrix.name }}
92+
path: |
93+
**/*.trx
94+
**/TestResults/**/*
95+
retention-days: 7
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Dependency Review
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- "feature/*"
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
dependency-review:
15+
name: "Dependency Review"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: "Checkout"
19+
uses: actions/checkout@v4
20+
21+
- name: "Dependency Review"
22+
uses: actions/dependency-review-action@v4
23+
with:
24+
# Fail the check if a vulnerability with 'moderate' severity or higher is found.
25+
fail-on-severity: moderate
26+
# Always post a summary of the check as a comment on the PR.
27+
comment-summary-in-pr: always

0 commit comments

Comments
 (0)