-
Notifications
You must be signed in to change notification settings - Fork 689
97 lines (77 loc) · 2.57 KB
/
ci-build-test.yml
File metadata and controls
97 lines (77 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: 🔧 Set up .NET
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1
with:
dotnet-version: |
10.0.x
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@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.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: 📦 Install dependencies for tests
run: npm install @modelcontextprotocol/conformance
- 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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
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