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!
-
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.
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]
Ensure you have the following tools installed:
- .NET Framework Developer Tools
- Git
- CI/CD tools for your environment as outlined in the workflow scripts.
-
Clone the Repository:
git clone https://github.com/GuilhermeStracini/POC-GHActions-CI-NetFramework.git
-
Review and Customize:
- Review the GitHub Actions workflows in
.github/workflows/
to tailor them to your needs.
- Review the GitHub Actions workflows in
-
Run Locally (Optional):
- Build and test the project locally:
msbuild YourSolution.sln vstest.console.exe YourTests.dll
- Build and test the project locally:
-
Push Changes:
- Push changes to trigger the pipeline:
git push origin main
- Push changes to trigger the pipeline:
Contributions are welcome!
Feel free to fork this repository, open issues, or submit pull requests to enhance the pipeline or project functionality.
This project is licensed under the MIT License.