Skip to content

Latest commit

 

History

History
136 lines (103 loc) · 4.12 KB

File metadata and controls

136 lines (103 loc) · 4.12 KB

GitHub Actions CI/CD Setup Complete

?? What Was Created

I've successfully set up a modern GitHub Actions CI/CD workflow for your MCEControl project. Here's what was added:

?? Workflow Files

1. .github/workflows/ci.yml - Main CI Workflow

  • Triggers on:
    • Push to develop branch
    • Pull requests targeting develop branch
  • Features:
    • ? Builds the solution using .NET 10.0
    • ? Runs all xUnit tests
    • ? Generates code coverage reports (using coverlet)
    • ? Publishes test results with visual reports
    • ? Uploads artifacts (coverage & test results)
    • ? Adds coverage summary to PR comments
    • ? Validates coverage thresholds

2. .github/workflows/pr-validation.yml - PR Quality Gates

  • Validates PR title format (conventional commits)
  • Checks for merge conflicts
  • Skips draft PRs automatically

?? Templates & Configuration

3. .github/pull_request_template.md

  • Standardized PR description template
  • Checklists for code quality
  • Links to related issues

4. .github/ISSUE_TEMPLATE/bug_report.md

  • Structured bug report template
  • Environment details section
  • Log attachment guidelines

5. .github/ISSUE_TEMPLATE/feature_request.md

  • Feature request template
  • Alternative solutions section
  • Contribution willingness checkbox

6. .github/dependabot.yml

  • Automated dependency updates
  • Groups minor/patch updates together
  • Separate configs for main project and tests
  • Weekly schedule on Mondays

7. .github/workflows/README.md

  • Complete documentation of all workflows
  • Status badge example
  • Local testing instructions
  • Troubleshooting guide

?? Next Steps

1. Add Status Badge to README

Add this to your main README.md:

[![CI](https://github.com/kindel/mcec/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/kindel/mcec/actions/workflows/ci.yml)

2. Test the Workflow

Create a test PR to the develop branch to see the workflow in action:

git checkout -b test/github-actions
git add .github/
git commit -m "ci: Add GitHub Actions CI/CD workflows"
git push origin test/github-actions

Then create a PR targeting develop.

3. Adjust Coverage Threshold (Optional)

In .github/workflows/ci.yml, line 96, you can adjust the coverage threshold:

$threshold = 0  # Change to desired percentage (e.g., 70 for 70%)

4. Configure Branch Protection Rules

In your GitHub repository settings, consider adding:

  • Require PR reviews before merging
  • Require status checks to pass (select "Build and Test")
  • Require branches to be up to date before merging

?? What the CI Workflow Does

  1. Checkout - Gets your code
  2. Setup .NET - Installs .NET 10.0 SDK
  3. Restore - Downloads NuGet packages
  4. Build - Compiles the solution in Release mode
  5. Test - Runs all xUnit tests with coverage collection
  6. Report - Generates HTML coverage reports
  7. Upload - Stores test results and coverage as artifacts
  8. Validate - Checks coverage thresholds

?? Key Features

  • Windows-specific: Uses windows-latest runner (required for Windows Forms)
  • Fast feedback: Builds and tests on every PR
  • Code coverage: Tracks test coverage with visual reports
  • Test results: Beautiful test result summaries in PR checks
  • Artifacts: 30-day retention of test results and coverage reports
  • Dependabot: Automatic dependency updates

??? Testing Locally

Run the same checks locally:

# From repository root
dotnet restore src/MCEControl.sln
dotnet build src/MCEControl.sln --configuration Release
dotnet test src/MCEControl.sln --configuration Release --collect:"XPlat Code Coverage"

?? Additional Resources

?? Workflow Status

Once you push these changes, you can view workflow runs at:

https://github.com/kindel/mcec/actions

All files are ready to commit! The CI workflow will automatically run when you push to develop or create a PR.