Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0336e26

Browse files
authored
add macos-latest to CI matrix (#707)
* add macos-latest to CI matrix * Update ci.yml * fix quotes * Update ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * remove expect lavapipe, not really necessary anymore * increase tolerance
1 parent 9ea662f commit 0336e26

File tree

2 files changed

+22
-96
lines changed

2 files changed

+22
-96
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ on:
1515

1616
jobs:
1717
test-build-full:
18-
name: Test Linux
19-
runs-on: ubuntu-latest
18+
name: Tests
2019
timeout-minutes: 25
2120
if: ${{ !github.event.pull_request.draft }}
2221
strategy:
@@ -26,6 +25,8 @@ jobs:
2625
imgui_dep: ["imgui", ""]
2726
notebook_dep: ["notebook", ""]
2827
pygfx_version: ["pygfx-release", "pygfx-main"]
28+
os: ["ubuntu-latest", "macos-latest"]
29+
runs-on: ${{ matrix.os }}
2930
steps:
3031
- uses: actions/checkout@v4
3132
with:
@@ -35,9 +36,19 @@ jobs:
3536
with:
3637
python-version: ${{ matrix.python }}
3738
- name: Install llvmpipe and lavapipe for offscreen canvas
39+
if: ${{ matrix.os == 'ubuntu-latest' }}
3840
run: |
3941
sudo apt-get update -y -qq
4042
sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev
43+
- name: Set up Homebrew
44+
if: ${{ matrix.os == 'macos-latest' }}
45+
id: set-up-homebrew
46+
uses: Homebrew/actions/setup-homebrew@master
47+
- name: Install gsed
48+
if: ${{ matrix.os == 'macos-latest' }}
49+
run: |
50+
brew install gnu-sed
51+
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH"
4152
- name: Install pygx from main
4253
if: ${{ matrix.pygfx_version == 'pygfx-main' }}
4354
run: |
@@ -56,115 +67,30 @@ jobs:
5667
python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
5768
- name: Test components
5869
env:
59-
PYGFX_EXPECT_LAVAPIPE: true
70+
WGPU_FORCE_OFFSCREEN: 1
6071
run: |
61-
WGPU_FORCE_OFFSCREEN=1 pytest -v tests/
72+
pytest -v tests/
6273
- name: Test examples
6374
env:
64-
PYGFX_EXPECT_LAVAPIPE: true
75+
WGPU_FORCE_OFFSCREEN: 1
6576
run: |
66-
WGPU_FORCE_OFFSCREEN=1 pytest -v examples/
77+
pytest -v examples/
6778
- name: Test examples notebooks, exclude ImageWidget notebook
6879
if: ${{ matrix.notebook_dep == 'notebook' }}
6980
env:
70-
PYGFX_EXPECT_LAVAPIPE: true
81+
FASTPLOTLIB_NB_TESTS: 1
7182
# test notebooks, exclude ImageWidget notebooks
72-
run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs)
83+
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs)
7384
- name: Test ImageWidget notebooks
7485
# test image widget notebooks only if imgui is installed
7586
if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }}
7687
env:
77-
PYGFX_EXPECT_LAVAPIPE: true
78-
run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs)
88+
FASTPLOTLIB_NB_TESTS: 1
89+
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs)
7990
- uses: actions/upload-artifact@v4
8091
if: ${{ failure() }}
8192
with:
8293
name: screenshot-diffs-${{ matrix.pyversion }}-${{ matrix.imgui_dep }}-${{ matrix.notebook_dep }}
8394
path: |
8495
examples/diffs
8596
examples/notebooks/diffs
86-
87-
88-
# test-build-full-mac:
89-
# name: Test Mac, notebook + glfw
90-
# runs-on: macos-14
91-
# if: ${{ !github.event.pull_request.draft }}
92-
# strategy:
93-
# fail-fast: false
94-
# matrix:
95-
# include:
96-
# - name: Test py310
97-
# pyversion: '3.10'
98-
# - name: Test py311
99-
# pyversion: '3.11'
100-
# - name: Test py312
101-
# pyversion: '3.12'
102-
# steps:
103-
# - uses: actions/checkout@v3
104-
# with:
105-
# lfs: true
106-
# - name: Set up Python
107-
# uses: actions/setup-python@v3
108-
# with:
109-
# python-version: ${{ matrix.pyversion }}
110-
# - name: Install dev dependencies
111-
# run: |
112-
# python -m pip install --upgrade pip setuptools
113-
# # remove pygfx from install_requires, we install using pygfx@main
114-
# pip install -e ".["tests"]"
115-
# pip install git+https://github.com/pygfx/pygfx.git@main
116-
# - name: Show wgpu backend
117-
# run:
118-
# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
119-
# - name: Test examples
120-
# run: |
121-
# pytest -v examples
122-
# pytest --nbmake examples/notebooks/
123-
# - uses: actions/upload-artifact@v3
124-
# if: ${{ failure() }}
125-
# with:
126-
# name: screenshot-diffs
127-
# path: |
128-
# examples/desktop/diffs
129-
# examples/notebooks/diffs
130-
#
131-
# test-build-glfw-mac:
132-
# name: Test Mac, glfw
133-
# runs-on: macos-14
134-
# if: ${{ !github.event.pull_request.draft }}
135-
# strategy:
136-
# fail-fast: false
137-
# matrix:
138-
# include:
139-
# - name: Test py310
140-
# pyversion: '3.10'
141-
# - name: Test py311
142-
# pyversion: '3.11'
143-
# - name: Test py312
144-
# pyversion: '3.12'
145-
# steps:
146-
# - uses: actions/checkout@v3
147-
# with:
148-
# lfs: true
149-
# - name: Set up Python
150-
# uses: actions/setup-python@v3
151-
# with:
152-
# python-version: ${{ matrix.pyversion }}
153-
# - name: Install dev dependencies
154-
# run: |
155-
# python -m pip install --upgrade pip setuptools
156-
# # remove pygfx from install_requires, we install using pygfx@main
157-
# pip install -e ".["tests-desktop"]"
158-
# pip install git+https://github.com/pygfx/pygfx.git@main
159-
# - name: Show wgpu backend
160-
# run:
161-
# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
162-
# - name: Test examples
163-
# run: |
164-
# pytest -v examples
165-
# - uses: actions/upload-artifact@v3
166-
# if: ${{ failure() }}
167-
# with:
168-
# name: screenshot-diffs
169-
# path: |
170-
# examples/desktop/diffs

examples/notebooks/nb_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
os.makedirs(SCREENSHOTS_DIR, exist_ok=True)
1717
os.makedirs(DIFFS_DIR, exist_ok=True)
1818

19-
TOLERANCE = 0.05
19+
TOLERANCE = 0.1
2020

2121
# store all the failures to allow the nb to proceed to test other examples
2222
FAILURES = list()

0 commit comments

Comments
 (0)