name: Build and Test on: # Manual trigger workflow_dispatch: # Run CI for all pushes to main push: branches: ["main"] # Run CI for pull requests to all branches, but only if code changed pull_request: paths: - ".github/workflows/ci-*.yml" - "*.sln" - "*.props" - "Makefile" - "global.json" - "src/**" - "tests/**" - "samples/**" - "docs/**" permissions: contents: read jobs: build: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] configuration: [Debug, Release] fail-fast: false runs-on: ${{ matrix.os }} steps: - name: ๐Ÿ“ฅ Clone the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: ๐Ÿ”ง Set up .NET uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0 with: dotnet-version: | 10.0.100-rc.1.25451.107 9.0.x # NetFX testing on non-Windows requires mono - name: ๐Ÿ”ง Setup Mono if: runner.os == 'Linux' run: sudo apt-get install -y mono-devel - name: ๐Ÿ”ง Setup Mono on macOS if: runner.os == 'macOS' run: brew install mono - name: ๐Ÿ”ง Set up Node.js uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: node-version: '20' - name: ๐Ÿ“ฆ Install dependencies for tests run: npm install @modelcontextprotocol/server-everything - name: ๐Ÿ“ฆ Install dependencies for tests run: npm install @modelcontextprotocol/server-memory - name: ๐Ÿ—๏ธ Build run: make build CONFIGURATION=${{ matrix.configuration }} - name: ๐Ÿงช Test run: make test CONFIGURATION=${{ matrix.configuration }} - name: ๐Ÿ“ฆ Pack if: matrix.configuration == 'Release' run: make pack CONFIGURATION=${{ matrix.configuration }} - name: ๐Ÿ“š Generate docs run: make generate-docs CONFIGURATION=${{ matrix.configuration }} - name: ๐Ÿ“ค Upload test results artifact if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: testresults-${{ matrix.os }}-${{ matrix.configuration }} path: artifacts/testresults/** publish-coverage: if: github.actor != 'dependabot[bot]' needs: build uses: ./.github/workflows/ci-code-coverage.yml secrets: inherit