-
Notifications
You must be signed in to change notification settings - Fork 2.9k
110 lines (93 loc) · 3.55 KB
/
Copy pathci-cli.yml
File metadata and controls
110 lines (93 loc) · 3.55 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
name: CI CLI
permissions:
contents: read
on:
pull_request:
paths:
- 'cli/**'
- 'services/mcp/src/cli/**'
- 'services/mcp/src/tools/**'
- 'services/mcp/src/api/**'
- 'services/mcp/schema/**'
- 'services/mcp/scripts/build-cli*.ts'
- 'services/mcp/scripts/hono-esbuild-config.ts'
- 'services/mcp/package.json'
- 'dist-workspace.toml'
- 'pnpm-lock.yaml'
- '.github/workflows/release.yml'
- '.github/workflows/ci-cli.yml'
- '.github/workflows/release-cli.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.91.1
- name: Check Cargo.lock is up to date
run: |
cargo update --workspace --locked
git diff --exit-code Cargo.lock
- name: Run tests
run: cargo test --all-features
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.91.1
components: clippy
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: cli
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.91.1
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
api-cli-release-bundle:
name: API CLI release bundle
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: .nvmrc
cache: 'pnpm'
- name: Install API CLI dependencies
run: pnpm --filter '@posthog/mcp...' install --frozen-lockfile
- name: Build API CLI release bundle
run: pnpm --dir services/mcp run build:cli:release
- name: Verify API CLI release bundle
run: node -e "const { statSync } = require('node:fs'); if (statSync('cli/lib/posthog-api-cli.mjs').size <= 0) process.exit(1)"