Skip to content

Use xvfb

Use xvfb #6

Workflow file for this run

on: push
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-ver: [3.8, 3.9]
experimental: [false]
include:
- python-ver: '3.10'
os: ubuntu-latest
experimental: true
- python-ver: '3.10'
os: macos-latest
experimental: true
- python-ver: '3.10'
os: windows-latest
experimental: true
- python-ver: 3.11
os: ubuntu-latest
experimental: true
- python-ver: 3.11
os: macos-latest
experimental: true
- python-ver: 3.11
os: windows-latest
experimental: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-ver }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests on ubuntu using xvfb
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install xvfb
sudo Xvfb :1 -screen 0 1024x768x24 </dev/null &
export DISPLAY=":1"
python -m pytest -v -s ./tests/
- name: Run tests on windows/mac
# Matches the 'o' in 'windows' or 'macos'
if: contains(matrix.os, 'o')
run: |
python -m pytest -v -s ./tests/
- name: Linting
run: |
pylint --rcfile=tests/pylintrc imshowtk tests
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install wheel twine setuptools
- name: Build wheel
run: |
python setup.py bdist_wheel
- name: Publish package if tagged release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
# You need to generate a PYPI API token and add it to your GitHub secrets
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}