-
Notifications
You must be signed in to change notification settings - Fork 749
217 lines (212 loc) · 8.19 KB
/
Copy pathcli_ci.yaml
File metadata and controls
217 lines (212 loc) · 8.19 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: cli-ci
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .agents/plugins/**
- .claude-plugin/**
- .cursor-plugin/**
- .github/plugin/**
- .github/workflows/cli_ci.yaml
- .github/actions/rust_install/**
- .cargo/**
- .agents/skills/**
- agent-plugins/**
- apps/cli/**
- apps/web/netlify.toml
- apps/web/public/llms.txt
- crates/agent-access/**
- crates/cloudsync/**
- crates/cli-docs/**
- crates/db-app/**
- crates/db-change/**
- crates/db-core/**
- crates/db-migrate/**
- crates/tiptap/**
- docs/**
- scripts/publish-anarlog-skill.mjs
- scripts/publish-anarlog-skill.test.mjs
- skills/**
- Cargo.lock
- Cargo.toml
- clippy.toml
- rust-toolchain.toml
- rustfmt.toml
pull_request:
paths:
- .agents/plugins/**
- .claude-plugin/**
- .cursor-plugin/**
- .github/plugin/**
- .github/workflows/cli_ci.yaml
- .github/actions/rust_install/**
- .cargo/**
- .agents/skills/**
- agent-plugins/**
- apps/cli/**
- apps/web/netlify.toml
- apps/web/public/llms.txt
- crates/agent-access/**
- crates/cloudsync/**
- crates/cli-docs/**
- crates/db-app/**
- crates/db-change/**
- crates/db-core/**
- crates/db-migrate/**
- crates/tiptap/**
- docs/**
- scripts/publish-anarlog-skill.mjs
- scripts/publish-anarlog-skill.test.mjs
- skills/**
- Cargo.lock
- Cargo.toml
- clippy.toml
- rust-toolchain.toml
- rustfmt.toml
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
cli-ci:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL /usr/local/share/powershell 2> /dev/null || true
df -h /
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: ./.github/actions/rust_install
- run: |
cargo test --locked -p agent-access
cargo test --locked -p anarlog-cli
cargo test --locked -p db-app --lib
cargo test --locked -p db-core --lib
cargo test --locked -p db-migrate --lib
cargo test --locked -p tiptap
- run: |
cargo clippy --locked \
-p agent-access \
-p anarlog-cli \
-p db-app \
-p db-core \
-p db-migrate \
-p tiptap \
--all-targets \
--no-deps \
-- \
-D warnings
- run: cargo build --locked --release -p anarlog-cli
- run: |
target/release/anarlog --help
target/release/anarlog --version
target/release/anarlog auth --help
target/release/anarlog meetings --help
target/release/anarlog mcp --help
target/release/anarlog proposals --help
if doctor_output="$(target/release/anarlog --json --db-path "$RUNNER_TEMP/missing.db" doctor)"; then
echo "doctor unexpectedly reported a missing database as ready"
exit 1
fi
grep -q '"ready": false' <<<"$doctor_output"
if invalid_output="$(target/release/anarlog --json meetings list --limit 0 2>&1)"; then
echo "invalid arguments unexpectedly succeeded"
exit 1
fi
grep -q '"code": "invalid_arguments"' <<<"$invalid_output"
auth_path="$RUNNER_TEMP/anarlog-auth-smoke.json"
auth_status="$(ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog --json auth status)"
grep -q '"command": "auth.status"' <<<"$auth_status"
grep -q '"signed_in": false' <<<"$auth_status"
auth_logout="$(ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog --json auth logout)"
grep -q '"command": "auth.logout"' <<<"$auth_logout"
grep -q '"signed_in": false' <<<"$auth_logout"
if auth_error="$(printf '%s\n' 'anarlog://auth/callback?access_token=cli-auth-secret-sentinel' | ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog --json auth login 2>&1)"; then
echo "incomplete auth callback unexpectedly succeeded"
exit 1
fi
grep -q '"code": "operation_failed"' <<<"$auth_error"
! grep -q 'cli-auth-secret-sentinel' <<<"$auth_error"
headless_auth_root="$RUNNER_TEMP/anarlog-auth-headless"
headless_logout="$(env -u DBUS_SESSION_BUS_ADDRESS XDG_DATA_HOME="$headless_auth_root" target/release/anarlog --json auth logout)"
grep -q '"command": "auth.logout"' <<<"$headless_logout"
headless_fallback="$headless_auth_root/com.hyprnote.stable/auth.cli.json"
test ! -e "$headless_fallback"
- run: |
test -s skills/anarlog/SKILL.md
test "$(sed -n '1p' skills/anarlog/SKILL.md)" = "---"
grep -Eq '^name:[[:space:]]+anarlog[[:space:]]*$' skills/anarlog/SKILL.md
grep -Eq '^description:[[:space:]]*(>|\||[^[:space:]])' skills/anarlog/SKILL.md
awk 'NR > 1 && $0 == "---" { found = 1; exit } END { if (!found) exit 1 }' skills/anarlog/SKILL.md
test "$(readlink docs/.mintlify/skills)" = "../../skills"
test -f docs/.mintlify/skills/anarlog/SKILL.md
node scripts/publish-anarlog-skill.mjs --check
node --test scripts/publish-anarlog-skill.test.mjs
skill_list="$(npx --yes skills@1.5.16 add . --list)"
echo "$skill_list"
grep -q 'anarlog' <<<"$skill_list"
! grep -q 'add-plugin' <<<"$skill_list"
- run: |
npx --yes mint@4.2.687 validate
npx --yes mint@4.2.687 broken-links
working-directory: docs
env:
PUPPETEER_SKIP_DOWNLOAD: "true"
cli-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: ./.github/actions/rust_install
with:
platform: windows
- run: cargo test --locked -p anarlog-cli
- run: |
cargo clippy --locked \
-p anarlog-cli \
--all-targets \
--no-deps \
-- \
-D warnings
shell: bash
- run: cargo build --locked --release -p anarlog-cli
- run: |
target/release/anarlog.exe --help
target/release/anarlog.exe --version
target/release/anarlog.exe auth --help
target/release/anarlog.exe meetings --help
target/release/anarlog.exe mcp --help
if doctor_output="$(target/release/anarlog.exe --json --db-path "$RUNNER_TEMP/missing.db" doctor)"; then
echo "doctor unexpectedly reported a missing database as ready"
exit 1
fi
grep -q '"ready": false' <<<"$doctor_output"
if invalid_output="$(target/release/anarlog.exe --json meetings list --limit 0 2>&1)"; then
echo "invalid arguments unexpectedly succeeded"
exit 1
fi
grep -q '"code": "invalid_arguments"' <<<"$invalid_output"
auth_path="$RUNNER_TEMP/anarlog-auth-smoke.json"
auth_status="$(ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog.exe --json auth status)"
grep -q '"command": "auth.status"' <<<"$auth_status"
grep -q '"signed_in": false' <<<"$auth_status"
auth_logout="$(ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog.exe --json auth logout)"
grep -q '"command": "auth.logout"' <<<"$auth_logout"
grep -q '"signed_in": false' <<<"$auth_logout"
if auth_error="$(printf '%s\n' 'anarlog://auth/callback?access_token=cli-auth-secret-sentinel' | ANARLOG_AUTH_PATH="$auth_path" target/release/anarlog.exe --json auth login 2>&1)"; then
echo "incomplete auth callback unexpectedly succeeded"
exit 1
fi
grep -q '"code": "operation_failed"' <<<"$auth_error"
! grep -q 'cli-auth-secret-sentinel' <<<"$auth_error"
shell: bash