Skip to content

Commit 5a52e75

Browse files
Update CI actions (#184)
Co-authored-by: Jenny Barry <116907872+jbarry-bdai@users.noreply.github.com> Co-authored-by: Jenny Barry <jbarry@theaiinstitute.com>
1 parent b9578cf commit 5a52e75

5 files changed

Lines changed: 42 additions & 22 deletions

File tree

.github/workflows/master.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ jobs:
1515
unittest:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
os: [windows-latest, ubuntu-22.04, macos-latest]
20-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
21+
# https://devguide.python.org/versions/
22+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2123
exclude:
2224
- os: windows-latest
2325
python-version: "3.11"
2426
- os: windows-latest
2527
python-version: "3.12"
2628

2729
steps:
28-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
2931
- name: Set up Python ${{ matrix.python-version }}
3032
uses: actions/setup-python@v5
3133
with:
@@ -36,21 +38,30 @@ jobs:
3638
pip install .[dev]
3739
- name: Test with pytest
3840
env:
39-
MPLBACKEND: TkAgg
41+
MPLBACKEND: Agg
4042
run: |
41-
pytest -s --ignore=W605 --timeout=50 --timeout_method=thread
43+
pytest -s --timeout=50 --timeout_method=thread
44+
45+
all-unittests-passed:
46+
needs: unittest
47+
if: always()
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Check unittest status
51+
if: ${{ needs.unittest.result != 'success' }}
52+
run: exit 1
4253

4354
codecov:
4455
# If all tests pass:
4556
# Run coverage and upload to codecov
4657
needs: unittest
4758
runs-on: ubuntu-22.04
4859
steps:
49-
- uses: actions/checkout@v2
50-
- name: Set up Python 3.8
60+
- uses: actions/checkout@v4
61+
- name: Set up Python 3.12
5162
uses: actions/setup-python@v5
5263
with:
53-
python-version: 3.8
64+
python-version: 3.12
5465
- name: Install dependencies
5566
run: |
5667
python -m pip install --upgrade pip
@@ -61,7 +72,7 @@ jobs:
6172
coverage report
6273
coverage xml
6374
- name: upload coverage to Codecov
64-
uses: codecov/codecov-action@v3
75+
uses: codecov/codecov-action@v5
6576
with:
6677
file: ./coverage.xml
6778
sphinx:

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
max-parallel: 2
1717
matrix:
1818
os: [ubuntu-22.04]
19-
python-version: [3.8]
19+
python-version: [3.12]
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- name: Set up Python
2424
uses: actions/setup-python@v5
2525
with:

.github/workflows/sphinx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-22.04
99
if: ${{ github.event_name != 'pull_request' }}
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python 3.8
11+
- uses: actions/checkout@v4
12+
- name: Set up Python 3.12
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: 3.8
15+
python-version: 3.12
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip

tests/base/test_transforms3d_plot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from math import pi
1515
import math
1616
from scipy.linalg import logm, expm
17+
import os
1718
import pytest
1819
import sys
1920

@@ -25,8 +26,9 @@
2526

2627
class Test3D(unittest.TestCase):
2728
@pytest.mark.skipif(
28-
sys.platform.startswith("darwin") and sys.version_info < (3, 11),
29-
reason="tkinter bug with mac",
29+
os.environ.get("CI") == "true"
30+
or (sys.platform.startswith("darwin") and sys.version_info < (3, 11)),
31+
reason="no display in CI / tkinter bug on mac",
3032
)
3133
def test_plot(self):
3234
plt.figure()
@@ -72,8 +74,9 @@ def test_plot(self):
7274
plt.close("all")
7375

7476
@pytest.mark.skipif(
75-
sys.platform.startswith("darwin") and sys.version_info < (3, 11),
76-
reason="tkinter bug with mac",
77+
os.environ.get("CI") == "true"
78+
or (sys.platform.startswith("darwin") and sys.version_info < (3, 11)),
79+
reason="no display in CI / tkinter bug on mac",
7780
)
7881
def test_animate(self):
7982
tranimate(transl(1, 2, 3), repeat=False, wait=True)

tests/test_spline.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import os
2+
import pytest
3+
14
import numpy.testing as nt
25
import numpy as np
36
import matplotlib.pyplot as plt
@@ -25,6 +28,7 @@ def test_evaluation(self):
2528
nt.assert_almost_equal(spline(0).A, self.control_poses[0].A)
2629
nt.assert_almost_equal(spline(1).A, self.control_poses[-1].A)
2730

31+
@pytest.mark.skipif(os.environ.get("CI") == "true", reason="no display in CI")
2832
def test_visualize(self):
2933
spline = BSplineSE3(self.control_poses)
3034
spline.visualize(
@@ -65,6 +69,7 @@ def test_small_delta_t(self):
6569
np.linspace(0, InterpSplineSE3._e, len(self.waypoints)), self.waypoints
6670
)
6771

72+
@pytest.mark.skipif(os.environ.get("CI") == "true", reason="no display in CI")
6873
def test_visualize(self):
6974
spline = InterpSplineSE3(self.times, self.waypoints)
7075
spline.visualize(
@@ -105,8 +110,9 @@ def test_spline_fit(self):
105110

106111
assert fit.max_angular_error() < np.deg2rad(5.0)
107112
assert fit.max_angular_error() < 0.1
108-
spline.visualize(
109-
sample_times=np.linspace(0, self.time_horizon, 100),
110-
animate=True,
111-
repeat=False,
112-
)
113+
if os.environ.get("CI") != "true":
114+
spline.visualize(
115+
sample_times=np.linspace(0, self.time_horizon, 100),
116+
animate=True,
117+
repeat=False,
118+
)

0 commit comments

Comments
 (0)