|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master |
| 11 | + - main |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + test: |
| 16 | + name: ${{ matrix.platform }} py${{ matrix.python-version }} |
| 17 | + runs-on: ${{ matrix.platform }} |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + platform: [ubuntu-latest, windows-latest, macos-latest] |
| 21 | + python-version: [3.7, 3.8, 3.9] |
| 22 | + |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + |
| 26 | + - name: Set up Python ${{ matrix.python-version }} |
| 27 | + uses: actions/setup-python@v2 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.python-version }} |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip |
| 34 | + pip install flit |
| 35 | + flit install --deps develop |
| 36 | +
|
| 37 | + # these libraries, along with pytest-xvfb (added in the `deps` in tox.ini), |
| 38 | + # enable testing on Qt on linux |
| 39 | + - name: Install Linux libraries |
| 40 | + if: runner.os == 'Linux' |
| 41 | + run: | |
| 42 | + sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \ |
| 43 | + libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ |
| 44 | + libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 |
| 45 | + pip install pytest-xvfb |
| 46 | +
|
| 47 | + # strategy borrowed from vispy for installing opengl libs on windows |
| 48 | + - name: Install Windows OpenGL |
| 49 | + if: runner.os == 'Windows' |
| 50 | + run: | |
| 51 | + git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git |
| 52 | + powershell gl-ci-helpers/appveyor/install_opengl.ps1 |
| 53 | +
|
| 54 | + - name: Test |
| 55 | + run: | |
| 56 | + pytest tests.py |
0 commit comments