From e17b053afc79c48f6fee19c59c4b31fa417b49c8 Mon Sep 17 00:00:00 2001 From: viamu Date: Fri, 30 Jan 2026 22:53:16 -0300 Subject: [PATCH] feat: add GitHub Actions CI workflows - Add ci.yml for build and test on push/PR to main - Add pr-validation.yml for PR checks with format verification - Add CI status badge to README Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++ .github/workflows/pr-validation.yml | 41 +++++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 81 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pr-validation.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f645979 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + name: Build and Test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + dotnet-quality: 'preview' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore --configuration Release + + - name: Test + run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + + - name: Upload coverage reports + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report + path: ./coverage + retention-days: 5 diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..c420832 --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,41 @@ +name: PR Validation + +on: + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + +jobs: + validate: + name: Validate PR + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + dotnet-quality: 'preview' + + - name: Restore dependencies + run: dotnet restore + + - name: Check formatting + run: dotnet format --verify-no-changes --verbosity diagnostic + + - name: Build + run: dotnet build --no-restore --configuration Release --warnaserror + + - name: Test + run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results + path: ./**/test-results.trx + retention-days: 5 diff --git a/README.md b/README.md index 774f838..28cf296 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # MCP Azure DevOps Server +[![CI](https://github.com/viamus/mcp-azure-devops/actions/workflows/ci.yml/badge.svg)](https://github.com/viamus/mcp-azure-devops/actions/workflows/ci.yml) [![.NET](https://img.shields.io/badge/.NET-10.0-512BD4)](https://dotnet.microsoft.com/) [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io/)