-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.12 KB
/
ci-python.yaml
File metadata and controls
40 lines (33 loc) · 1.12 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
name: Python Skills CI
on:
push:
paths:
- 'skills/**/actions/**/*.py'
- 'skills/**/*.py'
- 'tests/**/*.py'
jobs:
test-python-skills:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Dependencies & Run Tests
run: |
# Find all test directories inside tests/
for test_dir in tests/*/; do
if [ -d "$test_dir" ]; then
skill_name=$(basename "$test_dir")
echo "Testing skill: $skill_name"
# Check if requirements.txt exists for the test suite
if [ -f "$test_dir/requirements.txt" ]; then
pip install -r "$test_dir/requirements.txt"
fi
# Run pytest, adding the skill's directory to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$(pwd)/skills/$skill_name
# Run tests
pytest "$test_dir" || exit 1
fi
done