-
Notifications
You must be signed in to change notification settings - Fork 28
114 lines (97 loc) · 3.06 KB
/
ci.yml
File metadata and controls
114 lines (97 loc) · 3.06 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
push:
branches:
- main
# pull_request:
# branches:
# - "**"
workflow_call:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true
jobs:
rust_check:
name: Rust Checks (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false # Continue testing other OSes even if one fails
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Rust
uses: actions/cache@v4
with:
path: |
~/.rustup/toolchains
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-rust-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ matrix.os }}-rust-
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: Install cargo-make
uses: davidB/rust-cargo-make@v1
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run Clippy
run: cargo make clippy
continue-on-error: false
- name: Run Rustfmt
run: cargo make fmt -- --check
if: matrix.os == 'ubuntu-latest' # Run fmt only on Linux
- name: Run cargo doc
env:
RUSTDOCFLAGS: "-Dwarnings"
run: cargo doc --no-deps
if: matrix.os == 'ubuntu-latest' # Run doc only on Linux
- name: Spell Check
uses: crate-ci/typos@master
if: matrix.os == 'ubuntu-latest' # Run typos only on Linux
- name: Audit Dependencies
if: matrix.os == 'ubuntu-latest'
run: |
cargo install cargo-audit --version 0.20.0 --locked --force
cargo audit --deny warnings
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Audit Dependencies
# uses: actions-rust-lang/audit@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# if: matrix.os == 'ubuntu-latest' # Run audit only on Linux
# install nodejs that is required for tests
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20" # Stable Node.js version
# Verify npx is available
- name: Verify npx
run: npx --version
shell: bash
- name: Install server-everything globally
run: npm install -g @modelcontextprotocol/server-everything
shell: bash
# install Python and uvx that is required for tests
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11" # Stable Python version
- name: Install uv
run: pip install uv
shell: bash
- name: Verify uvx
run: uvx --version
shell: bash
- name: Run Tests
run: cargo make test
shell: bash # Ensure consistent shell
- name: Run Doc Tests
run: cargo make doc-test
shell: bash # Ensure consistent shell