-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.41 KB
/
Copy pathtest-scripts.yml
File metadata and controls
60 lines (48 loc) · 1.41 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
name: Test Operational Scripts
on:
pull_request:
paths:
- "skills/**/*.py"
- ".github/workflows/test-scripts.yml"
permissions:
contents: read
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install pyyaml
- name: Discover and run test_*.py scripts
env:
PYTHONIOENCODING: utf-8
run: |
set -euo pipefail
mapfile -t test_files < <(find skills -type f -name "test_*.py" | sort)
if [ "${#test_files[@]}" -eq 0 ]; then
echo "No test_*.py files found under skills/ — nothing to run."
exit 0
fi
echo "Found ${#test_files[@]} test file(s):"
printf ' %s\n' "${test_files[@]}"
echo
failures=()
for f in "${test_files[@]}"; do
echo "::group::$f"
if ! python "$f"; then
failures+=("$f")
fi
echo "::endgroup::"
done
echo
if [ "${#failures[@]}" -ne 0 ]; then
echo "FAILED (${#failures[@]}/${#test_files[@]}):"
printf ' %s\n' "${failures[@]}"
exit 1
fi
echo "All ${#test_files[@]} test file(s) passed."