Repository navigation
61 lines (54 loc) · 1.58 KB
/
Copy pathscript-tests.yml
File metadata and controls
61 lines (54 loc) · 1.58 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
name: Script tests
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
unittest:
name: ${{ matrix.os }}, Python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: ["3.9", "3.x"]
# actions/setup-python has no Python 3.9 build for Ubuntu 26.04, the
# image behind ubuntu-latest. 3.9 is end of life, so none will come.
exclude:
- os: ubuntu-latest
python: "3.9"
include:
- os: ubuntu-24.04
python: "3.9"
# The interpreter that ships with the developer tools of macOS.
- os: macos-latest
python: system
steps:
- uses: actions/checkout@v7
- if: matrix.python != 'system'
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Run the tests of the scripts of each skill
shell: bash
run: |
if [ "${{ matrix.python }}" = system ]; then
python=/usr/bin/python3
else
python=python3
fi
"$python" --version
found=0
for tests in skills/*/scripts/tests; do
[ -d "$tests" ] || continue
found=1
echo "::group::$tests"
"$python" -m unittest discover -s "$tests" -v
echo "::endgroup::"
done
if [ "$found" = 0 ]; then
echo "No script tests found under skills/*/scripts/tests."
exit 1
fi