-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02bfbea
commit 50d17fa
Showing
5 changed files
with
152 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Ui | ||
|
||
on: [push] | ||
|
||
jobs: | ||
ui: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install PySide2 PySide6 PyQt5 PyQt6 | ||
sudo apt-get ^Cstall xvfb | ||
- name: Checking our Python imports. | ||
run: | | ||
scripts/headless.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC2086,2068 | ||
# | ||
# Run each configure for all supported frameworks, and store them in `dist/ci`. | ||
# This requires the correct frameworks to be installed: | ||
# - PyQt5 | ||
# - PyQt6 | ||
# - PySide6 | ||
# And if using Python 3.10 or earlier: | ||
# - PySide2 | ||
|
||
set -eux pipefail | ||
|
||
scripts_home="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
project_home="$(dirname "${scripts_home}")" | ||
mkdir -p "${project_home}/dist/ci" | ||
cd "${project_home}" | ||
# shellcheck source=/dev/null | ||
. "${scripts_home}/shared.sh" | ||
|
||
# we xcb installed for our headless running, so exit if we don't have it | ||
if ! hash xvfb-run &>/dev/null; then | ||
>&2 echo "Do not have xvfb installed..." | ||
exit 1 | ||
fi | ||
|
||
# pop them into dist since it's ignored anyway | ||
if ! is-set PYTHON; then | ||
PYTHON=python | ||
fi | ||
frameworks=("pyqt5" "pyqt6" "pyside6") | ||
have_pyside=$(${PYTHON} -c 'import sys; print(sys.version_info < (3, 11))') | ||
if [[ "${have_pyside}" == "True" ]]; then | ||
frameworks+=("pyside2") | ||
fi | ||
|
||
# need to run everything in headless mode. | ||
# note: our shared libraries can be run without issues | ||
export QT_QPA_PLATFORM=offscreen | ||
for script in example/*.py; do | ||
if [[ "${script}" == "example/advanced-dock.py" ]]; then | ||
continue | ||
fi | ||
for framework in "${frameworks[@]}"; do | ||
echo "Running '${script}' for framework '${framework}'." | ||
xvfb-run -a "${PYTHON}" "${script}" --qt-framework "${framework}" | ||
done | ||
done | ||
|
||
# now we need to run our tests | ||
widgets=$(${PYTHON} -c "import os; os.chdir('test'); import ui; print(' '.join([i[5:] for i in dir(ui) if i.startswith('test_')]))") | ||
for widget in ${widgets[@]}; do | ||
for framework in "${frameworks[@]}"; do | ||
echo "Running test for widget '${widget}' for framework '${framework}'." | ||
xvfb-run -a "${PYTHON}" test/ui.py --widget "${widget}" --qt-framework "${framework}" | ||
done | ||
done |
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