-
-
Notifications
You must be signed in to change notification settings - Fork 132
129 lines (128 loc) · 4.82 KB
/
ci.yml
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
119
120
121
122
123
124
125
126
127
128
129
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']
qt-version: [5, 6]
qt-binding: [pyqt, pyside]
exclude:
- python-version: '3.10'
qt-version: 5
qt-binding: pyside
- python-version: '3.11'
qt-version: 5
- python-version: '3.12'
qt-version: 5
- python-version: '3.13'
qt-version: 5
- os: ubuntu-latest
qt-version: 6
qt-binding: pyside
fail-fast: false
steps:
- name: Checkout branch
uses: actions/checkout@v4
- 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)
run: |
sudo apt-get update --fix-missing;
if [ "${{ matrix.qt-version }}" == 5 ]; then
cat ci/qt5_linux.txt | xargs sudo apt-get -y install
else
cat ci/qt6_linux.txt | xargs sudo apt-get -y install
fi
sudo apt-get install -y 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@v5
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
pip install setuptools-scm[toml]
pip install numpy
pip install git+https://github.com/nucleic/cppy@main
pip install git+https://github.com/nucleic/[email protected]
pip install git+https://github.com/MatthieuDartiailh/bytecode@py313
pip install git+https://github.com/nucleic/kiwi@main
- name: Install project (no-extras)
if: matrix.python-version != '3.10'
env:
CPPFLAGS: --coverage
# Build extensions manually to allow getting C coverage data
run: |
pip install -e .[qt${{ matrix.qt-version }}-${{ matrix.qt-binding }}]
- name: Install project (with-extras pyqt)
if: matrix.python-version == '3.10' && matrix.qt-binding == 'pyqt'
env:
CPPFLAGS: --coverage
# Build extensions manually to allow getting C coverage data
run: |
pip install -e .[qt${{ matrix.qt-version }}-${{ matrix.qt-binding }},ipython-qt,matplotlib-qt,scintilla-qt${{ matrix.qt-version }}-pyqt,webview-qt${{ matrix.qt-version }}-pyqt]
- name: Install project (with-extras pyside)
if: matrix.python-version == '3.10' && matrix.qt-binding != 'pyqt'
env:
CPPFLAGS: --coverage
# Build extensions manually to allow getting C coverage data
run: |
pip install -e .[qt${{ matrix.qt-version }}-${{ matrix.qt-binding }},ipython-qt,matplotlib-qt]
- 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: Generate C++ coverage reports
if: (github.event_name != 'schedule' && matrix.os != 'windows-latest')
run: |
bash -c "find . -type f -name '*.gcno' -exec gcov -pb --all-blocks {} +" || true
ls
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
files: ./coverage.xml,*.gcov