fix: ci #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# TODO: include different versions of Qt and the 2 bindings (pyqt and pyside) on the matrix | ||
python: ["3.8", "3.9", "3.10"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
include: | ||
- python: "3.8" | ||
tox_env: "py38" | ||
- python: "3.9" | ||
tox_env: "py39" | ||
- python: "3.10" | ||
tox_env: "py310" | ||
steps: | ||
- name: Install linux only test dependency | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash | ||
# Install all dependencies needed to run Qt on linux (taken from the qt website | ||
# and completed by adding package marked missing when running with | ||
# QT_DEBUG_PLUGINS=1) | ||
run: | | ||
sudo apt-get update --fix-missing | ||
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-x11-dev libxcb-xtest0-dev libegl1-mesa xvfb fluxbox --fix-missing | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ".[testing]" | ||
- name: Run tests (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash -l {0} | ||
run: | | ||
export DISPLAY=:99.0 | ||
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset | ||
sleep 3 | ||
exec /usr/bin/startfluxbox & | ||
sleep 1 | ||
python -X dev -m pytest tests -v -s | ||
- name: Run tests (MacOS, Windows) | ||
if: matrix.os != 'ubuntu-latest' | ||
run: | | ||
python -X dev -m pytest tests -v -s | ||
deploy: | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
- name: Install wheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: | | ||
python -m build | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |