Skip to content

Commit 582e95d

Browse files
committed
Add cli test
1 parent c56ecad commit 582e95d

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

Diff for: .github/workflows/test.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Test Installation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
jobs:
14+
test-installation:
15+
name: Test on ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, windows-latest]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.12"
29+
30+
- name: Install uv (Linux)
31+
if: runner.os == 'Linux'
32+
run: |
33+
curl -LsSf https://astral.sh/uv/install.sh | sh
34+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
35+
36+
- name: Install uv (Windows)
37+
if: runner.os == 'Windows'
38+
run: |
39+
iwr -useb https://astral.sh/uv/install.ps1 | iex
40+
echo "$HOME\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
41+
42+
- name: Install package
43+
run: |
44+
uv pip install -e .
45+
46+
- name: Verify CLI works (Linux)
47+
if: runner.os == 'Linux'
48+
run: |
49+
# Run the help command and capture output
50+
output=$(llm --help)
51+
52+
# Check if the output contains expected help text
53+
if [[ "$output" == *"Run LangChain agent with MCP tools"* ]]; then
54+
echo "CLI help command works correctly"
55+
else
56+
echo "CLI help command failed to produce expected output"
57+
echo "Actual output:"
58+
echo "$output"
59+
exit 1
60+
fi
61+
62+
- name: Verify CLI works (Windows)
63+
if: runner.os == 'Windows'
64+
shell: pwsh
65+
run: |
66+
# Run the help command and capture output
67+
$output = llm --help
68+
69+
# Check if the output contains expected help text
70+
if ($output -match "Run LangChain agent with MCP tools") {
71+
Write-Host "CLI help command works correctly"
72+
} else {
73+
Write-Host "CLI help command failed to produce expected output"
74+
Write-Host "Actual output:"
75+
Write-Host $output
76+
exit 1
77+
}

0 commit comments

Comments
 (0)