-
Notifications
You must be signed in to change notification settings - Fork 15
170 lines (145 loc) · 6.44 KB
/
Copy pathdevcontainer-ci.yml
File metadata and controls
170 lines (145 loc) · 6.44 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
name: Dev Container CI
on:
push:
branches: [main]
paths:
- '.devcontainer/**'
- '.github/workflows/**'
pull_request:
branches: [main]
paths:
- '.devcontainer/**'
- '.github/workflows/**'
permissions:
contents: read
# Cancel in-progress runs for the same branch/PR
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─────────────────────────────────────────────────────────────────
# Job 1: Detect what changed (runs in <5 seconds)
# ─────────────────────────────────────────────────────────────────
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
infrastructure: ${{ steps.filter.outputs.infrastructure }}
runtime: ${{ steps.filter.outputs.runtime }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Detect changed files
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
infrastructure:
- '.devcontainer/post-create-cmd.sh'
- '.devcontainer/start-hermes.sh'
- '.devcontainer/self-check.sh'
- '.devcontainer/devcontainer.json'
- '.github/workflows/**'
runtime:
- '.devcontainer/skills/**'
- '.devcontainer/wiki/**'
- '.devcontainer/mnemon/**'
- '.devcontainer/memories/**'
- '.devcontainer/.hermes.md'
- '.devcontainer/codespace-cleanup.sh'
docs:
- 'README.md'
- '*.md'
# ─────────────────────────────────────────────────────────────────
# Job 2: Full build + smoke test (only if infrastructure changed)
# ─────────────────────────────────────────────────────────────────
full-build:
name: Build & Smoke Test
needs: detect-changes
if: needs.detect-changes.outputs.infrastructure == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: run post-create-cmd.sh
run: bash ./.devcontainer/post-create-cmd.sh
- name: run start-hermes.sh
run: bash ./.devcontainer/start-hermes.sh
- name: Smoke Test
run: |
bash ./.devcontainer/self-check.sh
echo "Smoke test passed!"
- name: Mnemon Integration Test
run: |
set -euo pipefail
TEST_NAME="ci-mnemon-$(date +%s)-$$"
echo "=== Mnemon Integration Test: $TEST_NAME ==="
echo "[1/3] Hermes remembers via mnemon_remember..."
hermes chat -q "my name is $TEST_NAME, remember this in mnemon" \
|| { echo "FAIL: Hermes failed"; exit 1; }
echo "[2/3] mnemon recall via CLI..."
mnemon recall "$TEST_NAME" --limit 5 2>&1 | grep -q "$TEST_NAME" \
|| { echo "FAIL: mnemon recall did not find $TEST_NAME"; exit 1; }
echo "[3/3] Claude retrieves via mnemon..."
CLAUDE_OUTPUT=$( \
$HOME/.local/bin/claude --dangerously-skip-permissions -p \
"Use mnemon recall to find my name. Reply with ONLY the name." 2>&1) || true
echo "Claude: $CLAUDE_OUTPUT"
echo "$CLAUDE_OUTPUT" | grep -q "$TEST_NAME" \
|| { echo "FAIL: Claude did not return $TEST_NAME"; }
echo "=== ALL MNEMON CHECKS PASSED ==="
# ── Collect logs on failure ──────────────────────────────────────
- name: Collect diagnostic logs
if: failure()
run: |
mkdir -p /tmp/failure-logs
# Service logs (written to /tmp by start scripts)
cp /tmp/modelrelay.log /tmp/failure-logs/ 2>/dev/null || true
cp /tmp/omniroute.log /tmp/failure-logs/ 2>/dev/null || true
cp /tmp/ollama.log /tmp/failure-logs/ 2>/dev/null || true
cp /tmp/ollama-pull.log /tmp/failure-logs/ 2>/dev/null || true
# Hermes logs
cp ~/.hermes/logs/gateway.log /tmp/failure-logs/ 2>/dev/null || true
cp ~/.hermes/logs/dashboard.log /tmp/failure-logs/ 2>/dev/null || true
# System diagnostics
ps aux > /tmp/failure-logs/ps-aux.txt 2>&1 || true
ss -tlnp > /tmp/failure-logs/ss-tlnp.txt 2>&1 || netstat -tlnp > /tmp/failure-logs/netstat-tlnp.txt 2>&1 || true
echo "=== Collected logs ==="
ls -la /tmp/failure-logs/
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: failure-logs-${{ github.run_id }}
path: /tmp/failure-logs/
if-no-files-found: warn
# ─────────────────────────────────────────────────────────────────
# Job 3: Lint & validation (for docs + runtime changes)
# ─────────────────────────────────────────────────────────────────
lint-check:
name: Lint & Validate
needs: detect-changes
if: |
needs.detect-changes.outputs.docs == 'true' ||
needs.detect-changes.outputs.runtime == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Run local CI lint check script
run: |
# Install markdownlint-cli (required by script)
npm install -g markdownlint-cli
# Run the canonical validation script
bash .devcontainer/skills/ci-lint-check/scripts/ci_lint_check.sh