Skip to content

Checks

Checks #282

Workflow file for this run

name: Checks
on:
push:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10']
os: [macos-latest, ubuntu-latest, windows-latest]
env:
# Display must be available globally for linux to know where xvfb is
DISPLAY: :0
PYTEST_QT_API: pyqt6
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Setup Qt6 (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
# Install X dependencies
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
# Install X dependencies
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libgl1-mesa-glx libsm6 libxext6 libgl1-mesa-dev x11-utils libxkbcommon-x11-0
sudo apt-get install -y libegl1 libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 x11-utils libxcb-cursor0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Install dependencies
run: |
# prerequisites
python -m pip install --upgrade pip wheel
python -m pip install coverage flake8 pytest
python -m pip install -r tests/requirements.txt
# install dependencies
pip install -e .
# show installed packages
pip freeze
- name: Start application and print version
env:
# Display must be available globally for linux to know where xvfb is
QT_DEBUG_PLUGINS: 1
run: |
python -m impose --version
- name: Test with pytest
run: |
pytest tests
coverage run --source=impose -m pytest tests
- name: Lint with flake8
run: |
flake8 .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
# There seems to be a problem with shapely/PyInstaller/macOS
# - name: Create app and check if it runs (macOS)
# if: runner.os == 'macOS'
# working-directory: ./build-recipes
# run: |
# bash ./macos_build_app.sh Impose $(python -m impose --version)
- name: Create app and check if it runs (Win)
if: runner.os == 'windows'
working-directory: ./build-recipes
run: |
pip install -r win_build_requirements.txt
pyinstaller -y --log-level=WARN win_Impose.spec
.\dist\Impose\\Impose.exe --version
python win_make_iss.py
iscc /Q win_impose.iss
- name: Upload build artifacts
if: (runner.os == 'windows' && matrix.python-version == '3.9')
uses: actions/upload-artifact@v3
with:
name: Impose_win
path: |
./build-recipes/Output/*.exe