Skip to content

🔬 Proof of Concept of a .NET Framework project using GitHub Actions for build, testing and deploy

License

Notifications You must be signed in to change notification settings

GuilhermeStracini/POC-GHActions-CI-NetFramework

Repository files navigation

PoC GitHub Actions CI Pipeline for .NET Framework

WakaTime License Last Commit

Build & Bump Version Build & Deploy Linter Check Update Packages

Maintainability Test Coverage CodeFactor


Overview

This repository demonstrates a proof of concept (PoC) for implementing a CI/CD pipeline for a .NET Framework 4.8 project using GitHub Actions.

🔗 For a detailed walkthrough, check out the accompanying blog article:
Using GitHub Actions to Create a .NET Framework Pipeline: Build, Test, and Deploy!


Features

Pipeline Highlights

  • Environment Setup:

    • Configure tools (MSBuild, VSTest, NuGet, Java for SonarCloud).
    • Cache dependencies for faster execution.
  • Build and Test:

    • Restore dependencies and build the project.
    • Run unit tests using VSTest.
  • Code Quality and Security:

    • Generate metrics using SonarCloud, Codacy, Code Climate, Snyk, and more.
  • Deployment:

    • Request approval for deployment.
    • Upload artifacts via FTP.
    • Execute deployment commands via SSH.

Pipeline Workflow

graph TD
    A[GitHub Actions Trigger] --> B[Checkout Code]
    B --> C[Configure Environment]
    C --> D[Restore Dependencies]
    D --> E[Build Project]
    E --> F[Test Project]
    F --> G{Code Quality Analysis}
    G -->|Pass| H[Upload Artifacts via FTP]
    G -->|Fail| I[Stop Pipeline]
    H --> J[Request Deployment Approval]
    J --> K[Deploy via SSH]
Loading

Getting Started

Prerequisites

Ensure you have the following tools installed:

  • .NET Framework Developer Tools
  • Git
  • CI/CD tools for your environment as outlined in the workflow scripts.

Steps to Use

  1. Clone the Repository:

    git clone https://github.com/GuilhermeStracini/POC-GHActions-CI-NetFramework.git
  2. Review and Customize:

    • Review the GitHub Actions workflows in .github/workflows/ to tailor them to your needs.
  3. Run Locally (Optional):

    • Build and test the project locally:
      msbuild YourSolution.sln
      vstest.console.exe YourTests.dll
  4. Push Changes:

    • Push changes to trigger the pipeline:
      git push origin main

Contribution

Contributions are welcome!
Feel free to fork this repository, open issues, or submit pull requests to enhance the pipeline or project functionality.


License

This project is licensed under the MIT License.