-
Notifications
You must be signed in to change notification settings - Fork 1
166 lines (137 loc) · 5.06 KB
/
Copy pathci.yml
File metadata and controls
166 lines (137 loc) · 5.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
rust:
name: Rust ${{ matrix.rust }}
runs-on: ubuntu-24.04
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust }}
strategy:
matrix:
rust: ["1.88.0", stable]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy, rustfmt
- name: Show active Rust toolchain
run: |
rustup show active-toolchain
rustc --version
cargo --version
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
- name: Check formatting
if: matrix.rust == 'stable'
run: cargo fmt --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run offline tests on MSRV
if: matrix.rust == '1.88.0'
env:
CARGO_NET_OFFLINE: "true"
run: cargo test --all-targets --locked
- name: Install coverage tooling
if: matrix.rust == 'stable'
run: |
rustup component add llvm-tools-preview
cargo install cargo-llvm-cov --version 0.9.0 --locked
- name: Run offline tests with coverage
if: matrix.rust == 'stable'
env:
CARGO_NET_OFFLINE: "true"
run: cargo llvm-cov --all-targets --all-features --locked --fail-under-lines 93
- name: Build release binary
run: cargo build --release --locked
- name: Install cargo-deny
if: matrix.rust == 'stable'
run: cargo install cargo-deny --version 0.20.2 --locked
- name: Audit dependencies, licenses, and sources
if: matrix.rust == 'stable'
run: cargo deny check all
native-artifact:
name: Native artifact (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: macos-14
target: aarch64-apple-darwin
executable: tiingo-mcp
- runner: macos-15-intel
target: x86_64-apple-darwin
executable: tiingo-mcp
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
executable: tiingo-mcp
- runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
executable: tiingo-mcp
- runner: windows-2025
target: x86_64-pc-windows-msvc
executable: tiingo-mcp.exe
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Rust 1.88.0
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.88.0
targets: ${{ matrix.target }}
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install Zig 0.14.1
if: runner.os == 'Linux'
uses: mlugg/setup-zig@v2
with:
version: 0.14.1
- name: Install cargo-zigbuild 0.23.2
if: runner.os == 'Linux'
run: cargo install cargo-zigbuild --version 0.23.2 --locked
- name: Build Linux artifact
if: runner.os == 'Linux'
run: cargo zigbuild --release --locked --target ${{ matrix.target }}
- name: Build native artifact
if: runner.os != 'Linux'
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Run version check
shell: bash
run: target/${{ matrix.target }}/release/${{ matrix.executable }} --version
- name: Build MCPB 0.3 bundle
shell: bash
run: bash packaging/mcpb/package.sh ${{ matrix.target }} target/${{ matrix.target }}/release
- name: Validate staged MCPB manifest with CLI 2.1.2
shell: bash
run: |
test "$(jq -r '.server.entry_point' target/mcpb/${{ matrix.target }}/manifest.json)" = "server/${{ matrix.executable }}"
crate_version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "tiingo-mcp") | .version')"
test "$(jq -r '.version' target/mcpb/${{ matrix.target }}/manifest.json)" = "$crate_version"
npx --yes @anthropic-ai/mcpb@2.1.2 validate target/mcpb/${{ matrix.target }}/manifest.json
- name: Inspect MCPB archive with CLI 2.1.2
shell: bash
run: npx --yes @anthropic-ai/mcpb@2.1.2 info target/distrib/tiingo-mcp-${{ matrix.target }}.mcpb
- name: Archive native binary
shell: bash
run: tar -czf target/distrib/tiingo-mcp-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release ${{ matrix.executable }}
- name: Upload native archive and MCPB bundle
uses: actions/upload-artifact@v7
with:
name: tiingo-mcp-${{ matrix.target }}
path: |
target/distrib/tiingo-mcp-${{ matrix.target }}.tar.gz
target/distrib/tiingo-mcp-${{ matrix.target }}.mcpb
if-no-files-found: error