Skip to content

Commit 4e6f035

Browse files
committed
Add cli test
1 parent c56ecad commit 4e6f035

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

Diff for: .github/workflows/test.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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: Create virtual environment (Linux)
43+
if: runner.os == 'Linux'
44+
run: |
45+
uv venv
46+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
47+
48+
- name: Create virtual environment (Windows)
49+
if: runner.os == 'Windows'
50+
run: |
51+
uv venv
52+
echo "$PWD\.venv\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53+
54+
- name: Install package
55+
run: |
56+
uv pip install -e .
57+
58+
- name: Verify CLI works (Linux)
59+
if: runner.os == 'Linux'
60+
run: |
61+
# Run the help command and capture output
62+
output=$(llm --help)
63+
64+
# Check if the output contains expected help text
65+
if [[ "$output" == *"Run LangChain agent with MCP tools"* ]]; then
66+
echo "CLI help command works correctly"
67+
else
68+
echo "CLI help command failed to produce expected output"
69+
echo "Actual output:"
70+
echo "$output"
71+
exit 1
72+
fi
73+
74+
- name: Verify CLI works (Windows)
75+
if: runner.os == 'Windows'
76+
shell: pwsh
77+
run: |
78+
# Run the help command and capture output
79+
$output = llm --help
80+
81+
# Check if the output contains expected help text
82+
if ($output -match "Run LangChain agent with MCP tools") {
83+
Write-Host "CLI help command works correctly"
84+
} else {
85+
Write-Host "CLI help command failed to produce expected output"
86+
Write-Host "Actual output:"
87+
Write-Host $output
88+
exit 1
89+
}

0 commit comments

Comments
 (0)