-
Notifications
You must be signed in to change notification settings - Fork 27
149 lines (123 loc) · 4.62 KB
/
test-providers.yml
File metadata and controls
149 lines (123 loc) · 4.62 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
name: Test LLM Providers
on:
# Run on manual trigger only
workflow_dispatch:
permissions:
contents: write
jobs:
test-providers:
runs-on: ubuntu-latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CODESTRAL_API_KEY: ${{ secrets.CODESTRAL_API_KEY }}
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_FREE_API_KEY: ${{ secrets.GOOGLE_FREE_API_KEY }}
GROK_API_KEY: ${{ secrets.GROK_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install llms-py package
run: |
python -m pip install --upgrade pip
pip install llms-py
- name: Verify installation
run: |
llms
- name: Test providers
id: test-providers
continue-on-error: true
run: |
# Create output directory
mkdir -p test-results
# Initialize results file
RESULTS_TXT="test-results/provider-test-results.txt"
echo "LLM Provider Test Results" > $RESULTS_TXT
echo "=========================" >> $RESULTS_TXT
echo "Date: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $RESULTS_TXT
echo "llms-py version: $(pip show llms-py | grep Version | cut -d' ' -f2)" >> $RESULTS_TXT
echo "" >> $RESULTS_TXT
# List of providers to test
PROVIDERS=(
"openrouter_free"
"groq"
"codestral"
"openrouter"
"google"
"anthropic"
"openai"
"grok"
"qwen"
"z.ai"
"qwen"
"mistral"
)
# Test each provider
for provider in "${PROVIDERS[@]}"; do
echo "Testing provider: $provider" >> $RESULTS_TXT
echo "-----------------------------------" >> $RESULTS_TXT
# Run the check command and capture output
if output=$(llms --check "$provider" 2>&1); then
echo "Status: PASS" >> $RESULTS_TXT
echo "$output" >> $RESULTS_TXT
else
echo "Status: FAIL" >> $RESULTS_TXT
echo "$output" >> $RESULTS_TXT
fi
echo "" >> $RESULTS_TXT
echo "" >> $RESULTS_TXT
done
echo "=========================" >> $RESULTS_TXT
echo "Test run completed" >> $RESULTS_TXT
# Display results in console
echo ""
echo "=========================================="
echo "Test Results Summary"
echo "=========================================="
cat $RESULTS_TXT
echo "=========================================="
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: provider-test-results
path: test-results/provider-test-results.txt
retention-days: 90
- name: Save results to repository
if: always()
run: |
# Create docs/checks directory if it doesn't exist
mkdir -p docs/checks
# Get current date in YYYY-MM-DD format
DATE=$(date -u '+%Y-%m-%d')
# Copy results to both latest.txt and dated file
cp test-results/provider-test-results.txt docs/checks/latest.txt
cp test-results/provider-test-results.txt docs/checks/${DATE}.txt
echo "Results saved to:"
echo " - docs/checks/latest.txt"
echo " - docs/checks/${DATE}.txt"
- name: Commit and push results
if: always()
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/checks/
# Check if there are changes to commit
if git diff --staged --quiet; then
echo "No changes to commit"
else
DATE=$(date -u '+%Y-%m-%d')
git commit -m "Update LLM provider test results - ${DATE}"
git push
echo "Results committed and pushed successfully"
fi