|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + types: |
| 11 | + - opened |
| 12 | + - reopened |
| 13 | + - synchronize |
| 14 | + - ready_for_review |
| 15 | + |
| 16 | +jobs: |
| 17 | + test-build-full: |
| 18 | + name: Tests - pygfx release |
| 19 | + timeout-minutes: 25 |
| 20 | + if: ${{ !github.event.pull_request.draft }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + python: ["3.11", "3.12", "3.13"] |
| 25 | + imgui_dep: ["imgui", ""] |
| 26 | + notebook_dep: ["notebook", ""] |
| 27 | + os: ["ubuntu-latest", "macos-latest"] |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + lfs: true |
| 33 | + - name: Set up Python |
| 34 | + uses: actions/setup-python@v5 |
| 35 | + with: |
| 36 | + python-version: ${{ matrix.python }} |
| 37 | + - name: Install llvmpipe and lavapipe for offscreen canvas |
| 38 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 39 | + run: | |
| 40 | + sudo apt-get update -y -qq |
| 41 | + sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev |
| 42 | + - name: Set up Homebrew |
| 43 | + if: ${{ matrix.os == 'macos-latest' }} |
| 44 | + id: set-up-homebrew |
| 45 | + uses: Homebrew/actions/setup-homebrew@master |
| 46 | + - name: Install gsed |
| 47 | + if: ${{ matrix.os == 'macos-latest' }} |
| 48 | + run: | |
| 49 | + brew install gnu-sed |
| 50 | + echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH" |
| 51 | + - name: Install fastplotlib |
| 52 | + run: | |
| 53 | + # create string with one of: tests,imgui,notebook; test,imgui; test,notebook ; tests |
| 54 | + # sed removes trailing comma |
| 55 | + # install fastplotlib with given extras options from above |
| 56 | + pip install -e ".[$(echo "tests,${{ matrix.imgui_dep }},${{ matrix.notebook_dep }}" | sed -e "s/,\+/,/g" -e "s/,$//")]" |
| 57 | + - name: Show wgpu backend |
| 58 | + run: |
| 59 | + python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" |
| 60 | + - name: Test components |
| 61 | + env: |
| 62 | + WGPU_FORCE_OFFSCREEN: 1 |
| 63 | + run: | |
| 64 | + pytest -v tests/ |
| 65 | + - name: Test examples |
| 66 | + env: |
| 67 | + WGPU_FORCE_OFFSCREEN: 1 |
| 68 | + run: | |
| 69 | + pytest -v examples/ |
| 70 | + - name: Test examples notebooks, exclude ImageWidget notebook |
| 71 | + if: ${{ matrix.notebook_dep == 'notebook' }} |
| 72 | + env: |
| 73 | + FASTPLOTLIB_NB_TESTS: 1 |
| 74 | + # test notebooks, exclude ImageWidget notebooks |
| 75 | + run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs) |
| 76 | + - name: Test ImageWidget notebooks |
| 77 | + # test image widget notebooks only if imgui is installed |
| 78 | + if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }} |
| 79 | + env: |
| 80 | + FASTPLOTLIB_NB_TESTS: 1 |
| 81 | + run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs) |
| 82 | + - uses: actions/upload-artifact@v4 |
| 83 | + if: ${{ failure() }} |
| 84 | + with: |
| 85 | + name: screenshot-diffs-${{ matrix.pyversion }}-${{ matrix.imgui_dep }}-${{ matrix.notebook_dep }} |
| 86 | + path: | |
| 87 | + examples/diffs |
| 88 | + examples/notebooks/diffs |
0 commit comments