Skip to content

Commit

Permalink
refactor: Limit test run (#603)
Browse files Browse the repository at this point in the history
* limit runs of azure pipelines, prepare to use feature_prepare branch before PR

* remove requires.io from badge list

* limit github test from feature branch

* check if workflow works

* fix path

* try use new workflows in test of napari widgets

* fix typo

* fix napari widgets configuration

* fix typo

* list files

* fix download artifact

* move coverage to workflow

* fix backend selection

* fix naming

* limit test run

* update conda configuration

* pin napari in tox
  • Loading branch information
Czaki authored Apr 29, 2022
1 parent 2007b69 commit 3786918
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 222 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/base_test_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
on:
workflow_call:
inputs:
python_version:
required: true
type: string
os:
required: true
type: string
tox_args:
required: false
type: string
default: ""
napari:
required: false
type: string
default: >-
["None"]
qt_backend:
required: false
type: string
default: >-
["PyQt5", "PySide2"]
test_data:
required: false
type: boolean
default: False
coverage:
required: false
type: boolean
default: False


jobs:
test:
name: ${{ matrix.os }} py ${{ matrix.python_version }} ${{ matrix.napari }} ${{ matrix.qt_backend }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os)}}
python_version: ${{fromJson(inputs.python_version)}}
napari_version: ${{fromJson(inputs.napari)}}
qt_backend: ${{fromJson(inputs.qt_backend)}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}

- name: Install ubuntu libraries
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
- name: Download test data
if: ${{ inputs.test_data }}
uses: actions/download-artifact@v3
with:
name: test_data
path: test_data

- name: Install dependencies
run: |
python -m pip install -r requirements/requirements_dev.txt tox-gh-actions
- name: Test with tox
# run tests using pip install --pre
uses: GabrielBB/xvfb-action@v1
timeout-minutes: 60
with:
run: python -m tox ${{ inputs.tox_args }}
env:
PYVISTA_OFF_SCREEN: True # required for opengl on windows
NAPARI: ${{ matrix.napari_version }}
BACKEND: ${{ matrix.qt_backend }}

- uses: codecov/codecov-action@v1
if: ${{ inputs.coverage }}
with:
file: ./coverage.xml
fail_ci_if_error: true
67 changes: 24 additions & 43 deletions .github/workflows/test_napari_widgets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,28 @@ on:
- '**'

jobs:
test_napari:
name: ${{ matrix.napari_version }} py${{ matrix.python }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-20.04 ]
python: ['3.9']
napari_version: [napari412, napari413, napari414, napari415]
steps:
- uses: actions/checkout@v2
test-pyqt5:
name: PyQt5
uses: ./.github/workflows/base_test_workflow.yml
with:
python_version: >-
["3.9"]
os: >-
["ubuntu-20.04"]
napari: >-
["napari412", "napari413", "napari414", "napari415"]
qt_backend: >-
["PyQt5"]
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install Windows OpenGL
if: runner.os == 'Windows'
run: |
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
powershell gl-ci-helpers/appveyor/install_opengl.ps1
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}
- name: Install ubuntu libraries
if: runner.os == 'Linux'
run: |
sudo apt-get install -y libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- name: Install dependencies
run: |
pip install --upgrade pip
pip install setuptools tox tox-gh-actions
- name: Test with tox
# run tests using pip install --pre
uses: GabrielBB/xvfb-action@v1
timeout-minutes: 60
with:
run: python -m tox
env:
PLATFORM: ${{ matrix.platform }}
NAPARI: ${{ matrix.napari_version }}
PYVISTA_OFF_SCREEN: True # required for opengl on Windows
test-pyside2:
name: PySide2
uses: ./.github/workflows/base_test_workflow.yml
with:
python_version: >-
["3.9"]
os: >-
["ubuntu-20.04"]
napari: >-
["napari412", "napari415"]
qt_backend: >-
["PySide2"]
Loading

0 comments on commit 3786918

Please sign in to comment.