-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (49 loc) · 1.85 KB
/
pytest.yaml
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
name: Run Tests
on:
pull_request:
push:
branches:
- main
- ci-dev
jobs:
tests:
name: Run Unit Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ 3.9,'3.10','3.11']
#os: [ubuntu-latest, windows-latest, macos-latest] # avoid this cost untill it becomes necessary..
package: [airo-typing,airo-spatial-algebra, airo-camera-toolkit, airo-robots, airo-teleop, airo-dataset-tools] #TODO: autodiscover?
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/setup.py
**/requirements*.txt
- name: Install package
run: |
python -m pip install --upgrade pip
pip install wheel setuptools
pip install "pytest<8.0.0"
pip install airo-typing/ airo-spatial-algebra/ airo-camera-toolkit/ airo-robots/ airo-teleop/ airo-dataset-tools/
- name: Run Tests
run: pytest ${{matrix.package}}/
- name: Run Notebooks
# cannot use glob patter because that fails if no notebooks are found (in which case the glob pattern is empty.)
# so cannot do something like pytest --nbmake ${{matrix.package}}/**/*.ipynb
# and we also don't want to re-execute all regular tests (pytest --nbmake .)
# so manually iterate over all files and run pytest --nbmake on each one.
# don't forget to enable glob! https://github.com/orgs/community/discussions/25638
run: |
pip install nbmake
python -m ipykernel install --user --name airo-mono
shopt -s globstar nullglob
echo "Testing notebooks..."
for nb in ${{matrix.package}}/**/*.ipynb; do
pytest --nbmake $nb;
done