-
Notifications
You must be signed in to change notification settings - Fork 2
154 lines (132 loc) · 4.53 KB
/
e2e-cli.yml
File metadata and controls
154 lines (132 loc) · 4.53 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
name: E2E CLI Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
e2e-cli:
name: E2E CLI - ${{ matrix.cli }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
environment: e2e-cli
strategy:
fail-fast: false
matrix:
cli: [claude-code, gemini, opencode, copilot, codex]
os: [ubuntu-24.04, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler libclang-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install protobuf llvm
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@v2
with:
shared-key: "e2e-cli-${{ matrix.os }}"
- name: Build daemon and ingest binaries
run: cargo build -p memory-daemon -p memory-ingest
- name: Install bats-core (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y bats
- name: Install bats-core (macOS)
if: runner.os == 'macOS'
run: |
brew install bats-core
- name: Install bats helper libraries
run: |
mkdir -p tests/cli/lib
git clone --depth 1 https://github.com/bats-core/bats-support.git tests/cli/lib/bats-support
git clone --depth 1 https://github.com/bats-core/bats-assert.git tests/cli/lib/bats-assert
- name: Verify jq is available
run: jq --version
- name: Run bats tests
id: bats_run
continue-on-error: true
env:
BATS_LIB_PATH: tests/cli/lib
MEMORY_DAEMON_BIN: target/debug/memory-daemon
MEMORY_INGEST_BIN: target/debug/memory-ingest
run: |
mkdir -p tests/cli/.runs
if [ -d "tests/cli/${{ matrix.cli }}" ]; then
bats --report-formatter junit --output tests/cli/.runs tests/cli/${{ matrix.cli }}/ 2>&1 | tee e2e-cli-results.txt
else
echo "No tests found for ${{ matrix.cli }} — skipping"
echo "::notice::No bats tests found for ${{ matrix.cli }}, skipping"
exit 0
fi
- name: Upload JUnit XML report
if: always()
uses: actions/upload-artifact@v4
with:
name: junit-${{ matrix.cli }}-${{ matrix.os }}
path: tests/cli/.runs/report.xml
if-no-files-found: ignore
retention-days: 14
- name: Upload failure artifacts
if: failure() || steps.bats_run.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
name: failure-artifacts-${{ matrix.cli }}-${{ matrix.os }}
path: |
tests/cli/.runs/
e2e-cli-results.txt
if-no-files-found: ignore
retention-days: 7
- name: Report summary
if: always()
run: |
echo "## E2E CLI Results: ${{ matrix.cli }} (${{ matrix.os }})" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ -f e2e-cli-results.txt ]; then
echo '```' >> $GITHUB_STEP_SUMMARY
tail -20 e2e-cli-results.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo "No test results file found." >> $GITHUB_STEP_SUMMARY
fi
- name: Check bats test result
if: always() && steps.bats_run.outcome == 'failure'
run: |
echo "Bats tests failed for ${{ matrix.cli }}"
exit 1
matrix-report:
name: CLI Matrix Report
needs: [e2e-cli]
if: always()
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all JUnit artifacts
uses: actions/download-artifact@v4
with:
path: junit-reports
pattern: junit-*
merge-multiple: false
- name: Generate matrix report
run: |
chmod +x scripts/cli-matrix-report.sh
scripts/cli-matrix-report.sh junit-reports >> $GITHUB_STEP_SUMMARY
- name: Upload matrix report
if: always()
uses: actions/upload-artifact@v4
with:
name: cli-matrix-report
path: junit-reports/
if-no-files-found: ignore
retention-days: 14