Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 21 additions & 95 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ on:

jobs:
test-build-full:
name: Test Linux
runs-on: ubuntu-latest
name: Tests
timeout-minutes: 25
if: ${{ !github.event.pull_request.draft }}
strategy:
Expand All @@ -26,6 +25,8 @@ jobs:
imgui_dep: ["imgui", ""]
notebook_dep: ["notebook", ""]
pygfx_version: ["pygfx-release", "pygfx-main"]
os: ["ubuntu-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -35,9 +36,19 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install llvmpipe and lavapipe for offscreen canvas
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update -y -qq
sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev
- name: Set up Homebrew
if: ${{ matrix.os == 'macos-latest' }}
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install gsed
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install gnu-sed
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH"
- name: Install pygx from main
if: ${{ matrix.pygfx_version == 'pygfx-main' }}
run: |
Expand All @@ -56,115 +67,30 @@ jobs:
python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
- name: Test components
env:
PYGFX_EXPECT_LAVAPIPE: true
WGPU_FORCE_OFFSCREEN: 1
run: |
WGPU_FORCE_OFFSCREEN=1 pytest -v tests/
pytest -v tests/
- name: Test examples
env:
PYGFX_EXPECT_LAVAPIPE: true
WGPU_FORCE_OFFSCREEN: 1
run: |
WGPU_FORCE_OFFSCREEN=1 pytest -v examples/
pytest -v examples/
- name: Test examples notebooks, exclude ImageWidget notebook
if: ${{ matrix.notebook_dep == 'notebook' }}
env:
PYGFX_EXPECT_LAVAPIPE: true
FASTPLOTLIB_NB_TESTS: 1
# test notebooks, exclude ImageWidget notebooks
run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs)
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs)
- name: Test ImageWidget notebooks
# test image widget notebooks only if imgui is installed
if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }}
env:
PYGFX_EXPECT_LAVAPIPE: true
run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs)
FASTPLOTLIB_NB_TESTS: 1
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs)
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: screenshot-diffs-${{ matrix.pyversion }}-${{ matrix.imgui_dep }}-${{ matrix.notebook_dep }}
path: |
examples/diffs
examples/notebooks/diffs


# test-build-full-mac:
# name: Test Mac, notebook + glfw
# runs-on: macos-14
# if: ${{ !github.event.pull_request.draft }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Test py310
# pyversion: '3.10'
# - name: Test py311
# pyversion: '3.11'
# - name: Test py312
# pyversion: '3.12'
# steps:
# - uses: actions/checkout@v3
# with:
# lfs: true
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.pyversion }}
# - name: Install dev dependencies
# run: |
# python -m pip install --upgrade pip setuptools
# # remove pygfx from install_requires, we install using pygfx@main
# pip install -e ".["tests"]"
# pip install git+https://github.com/pygfx/pygfx.git@main
# - name: Show wgpu backend
# run:
# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
# - name: Test examples
# run: |
# pytest -v examples
# pytest --nbmake examples/notebooks/
# - uses: actions/upload-artifact@v3
# if: ${{ failure() }}
# with:
# name: screenshot-diffs
# path: |
# examples/desktop/diffs
# examples/notebooks/diffs
#
# test-build-glfw-mac:
# name: Test Mac, glfw
# runs-on: macos-14
# if: ${{ !github.event.pull_request.draft }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: Test py310
# pyversion: '3.10'
# - name: Test py311
# pyversion: '3.11'
# - name: Test py312
# pyversion: '3.12'
# steps:
# - uses: actions/checkout@v3
# with:
# lfs: true
# - name: Set up Python
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.pyversion }}
# - name: Install dev dependencies
# run: |
# python -m pip install --upgrade pip setuptools
# # remove pygfx from install_requires, we install using pygfx@main
# pip install -e ".["tests-desktop"]"
# pip install git+https://github.com/pygfx/pygfx.git@main
# - name: Show wgpu backend
# run:
# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
# - name: Test examples
# run: |
# pytest -v examples
# - uses: actions/upload-artifact@v3
# if: ${{ failure() }}
# with:
# name: screenshot-diffs
# path: |
# examples/desktop/diffs
2 changes: 1 addition & 1 deletion examples/notebooks/nb_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
os.makedirs(SCREENSHOTS_DIR, exist_ok=True)
os.makedirs(DIFFS_DIR, exist_ok=True)

TOLERANCE = 0.05
TOLERANCE = 0.1

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