1+ name : CLI Compatibility Tests
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ CLI-Compatibility :
11+ runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ python-version : ["3.9", "3.10", "3.11", "3.12"]
15+ typer-version : ["0.16.0", "0.17.0", "0.18.0", "0.19.2"]
16+ click-version : ["8.1.0", "8.2.0"]
17+ exclude :
18+ - python-version : " 3.9"
19+ click-version : " 8.2.0"
20+ - typer-version : " 0.16.0"
21+ click-version : " 8.2.0"
22+ - typer-version : " 0.16.0"
23+ click-version : " 8.2.1"
24+ - typer-version : " 0.16.0"
25+ click-version : " 8.3.0"
26+ steps :
27+ - uses : actions/checkout@v4
28+ - name : Set up Python ${{ matrix.python-version }}
29+ uses : actions/setup-python@v5
30+ with :
31+ python-version : ${{ matrix.python-version }}
32+
33+ - name : Install Poetry
34+ uses : snok/install-poetry@v1
35+
36+ - name : Install Dependencies
37+ run : |
38+ # Setup Virtual Environment
39+ python3 -m venv ./.venv
40+ source .venv/bin/activate
41+
42+ # Install dev dependencies
43+ if [ "${{ matrix.python-version }}" == "3.9" ]; then
44+ pip install .[dev]
45+ else
46+ poetry install --extras dev
47+ fi
48+
49+ # Install specific typer and click versions
50+ pip install typer==${{ matrix.typer-version }} click==${{ matrix.click-version }}
51+
52+ - name : Test CLI Commands
53+ run : |
54+ source .venv/bin/activate
55+
56+ # Test basic CLI help
57+ guardrails --help
58+
59+ # Test validate command help
60+ guardrails validate --help
61+
62+ # Test hub command help
63+ guardrails hub --help
64+
65+ # Test configure command help
66+ guardrails configure --help
67+
68+ # Test hub list command (end-to-end)
69+ guardrails hub list
70+
71+ # Create a simple RAIL spec for testing validate command
72+ cat > test_spec.rail << 'EOF'
73+ <rail version="0.1">
74+ <output>
75+ <string name="answer" description="A simple answer"/>
76+ </output>
77+ <prompt>
78+ Answer the question: What is 2+2?
79+ </prompt>
80+ </rail>
81+ EOF
82+
83+ # Test validate command end-to-end with the RAIL spec
84+ echo '{"answer": "4"}' | guardrails validate test_spec.rail -
85+
86+ # Clean up
87+ rm test_spec.rail
0 commit comments