name: Test on: push: branches: - master - main tags: - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 pull_request: branches: - master - main workflow_dispatch: jobs: test: name: ${{ matrix.platform }} py${{ matrix.python-version }} ${{ matrix.backend }} runs-on: ${{ matrix.platform }} timeout-minutes: 10 strategy: fail-fast: false matrix: platform: [ubuntu-latest, windows-latest, macos-latest] python-version: [3.7, 3.8, 3.9] backend: [pyqt5, pyside2] include: # pyqt6 and pyside6 on latest platforms - python-version: 3.9 platform: ubuntu-latest backend: pyside6 screenshot: 1 - python-version: 3.9 platform: windows-latest backend: pyside6 screenshot: 1 - python-version: 3.9 platform: macos-11.0 backend: pyside6 screenshot: 1 - python-version: 3.9 platform: ubuntu-latest backend: pyqt6 - python-version: 3.9 platform: windows-latest backend: pyqt6 - python-version: 3.9 platform: macos-11.0 backend: pyqt6 # big sur, 3.9 - python-version: 3.9 platform: macos-11.0 backend: pyside2 - python-version: 3.9 platform: macos-11.0 backend: pyqt5 # legacy OS - python-version: 3.8 platform: ubuntu-18.04 backend: pyside2 - python-version: 3.6 platform: ubuntu-16.04 backend: pyqt5 - python-version: 3.6 platform: windows-2016 backend: pyqt5 # legacy Qt - python-version: 3.7 platform: ubuntu-latest backend: pyqt511 - python-version: 3.7 platform: ubuntu-latest backend: pyside511 steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install Linux libraries if: runner.os == 'Linux' run: | sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \ libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ libxcb-xinerama0 libxcb-xfixes0 - name: Linux opengl if: runner.os == 'Linux' && ( matrix.backend == 'pyside6' || matrix.backend == 'pyqt6' ) run: sudo apt-get install -y libopengl0 libegl1-mesa libxcb-xinput0 - name: Install dependencies run: | python -m pip install --upgrade pip pip install setuptools tox tox-gh-actions - name: Test with tox run: tox env: PLATFORM: ${{ matrix.platform }} BACKEND: ${{ matrix.backend }} - name: Coverage uses: codecov/codecov-action@v1 - name: Install for screenshots if: matrix.screenshot run: pip install . ${{ matrix.backend }} - name: Screenshots (Linux) if: runner.os == 'Linux' && matrix.screenshot uses: GabrielBB/xvfb-action@v1 with: run: python examples/demo_widget.py -snap - name: Screenshots (macOS/Win) if: runner.os != 'Linux' && matrix.screenshot run: python examples/demo_widget.py -snap - uses: actions/upload-artifact@v2 if: matrix.screenshot with: name: screenshots ${{ runner.os }} path: screenshots deploy: # this will run when you have tagged a commit, starting with "v*" # and requires that you have put your twine API key in your # github secrets (see readme for details) needs: [test] if: ${{ github.repository == 'napari/superqt' && contains(github.ref, 'tags') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: python-version: "3.x" - name: Install dependencies run: | python -m pip install --upgrade pip pip install -U setuptools setuptools_scm wheel twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} run: | git tag python setup.py sdist bdist_wheel twine upload dist/*