1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
name: Continuous Integration
on:
schedule:
- cron: '0 0 * * 2'
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/ci.yml
- "enaml/**"
- "examples/**"
- "tests/**"
- setup.py
- pyproject.toml
jobs:
tests:
name: Unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14-dev']
qt-version: [5, 6]
qt-binding: [pyqt]
exclude:
- python-version: '3.10'
os: macos-latest
- python-version: '3.11'
qt-version: 5
- python-version: '3.12'
qt-version: 5
- python-version: '3.13'
qt-version: 5
- python-version: '3.14-dev'
qt-version: 5
fail-fast: false
steps:
- name: Checkout branch
uses: actions/checkout@v5
- name: Install linux only test dependency
if: matrix.os == 'ubuntu-latest'
# Install all dependencies needed to run Qt on linux (taken from the qt website)
# https://doc.qt.io/qt-6/linux.html
# https://doc.qt.io/qt-6/linux-requirements.html
run: |
sudo apt-get update --fix-missing;
cat ci/qt6_linux.txt | xargs sudo apt -y install
sudo apt install -y xvfb herbstluftwm scrot
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'test_requirements.txt'
- name: Install dependencies
# Skip pegen deps because of https://github.com/we-like-parsers/pegen/issues/53
run: |
python -m pip install --upgrade pip setuptools
pip install setuptools-scm[toml]
pip install numpy
pip install git+https://github.com/nucleic/cppy@main
pip install git+https://github.com/nucleic/atom@main
pip install git+https://github.com/MatthieuDartiailh/bytecode@main
pip install git+https://github.com/nucleic/kiwi@main
- name: Install project (no-extras)
if: matrix.python-version != '3.10'
env:
CPPFLAGS: --coverage
# Use legacy command to install the library to be able to measure
# coverage of C++ code.
run: |
pip install .[qt${{ matrix.qt-version }}-${{ matrix.qt-binding }}]
pip uninstall enaml --yes
python setup.py develop
- name: Install project (with-extras pyqt)
if: matrix.python-version == '3.10' && matrix.qt-binding == 'pyqt'
env:
CPPFLAGS: --coverage
# Use legacy command to install the library to be able to measure
# coverage of C++ code.
run: |
pip install .[qt${{ matrix.qt-version }}-${{ matrix.qt-binding }},ipython-qt,matplotlib-qt,scintilla-qt${{ matrix.qt-version }}-pyqt,webview-qt${{ matrix.qt-version }}-pyqt]
pip uninstall enaml --yes
python setup.py develop
- name: Install test requirements
run: |
pip install -r test_requirements.txt
- name: Run tests (Windows, Mac)
if: matrix.os != 'ubuntu-latest'
run: python -X dev -m pytest tests -v --cov --cov-report xml -rs
- name: Run tests (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
pip uninstall python3-xlib --yes
pip install python-xlib
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
herbstluftwm &
sleep 1
python -X dev -m pytest tests -v --cov --cov-report xml -rs
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
|