Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
validate:
runs-on: windows-2022
timeout-minutes: 15
steps:
- uses: actions/checkout@v6

Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/cross-platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: ${{ matrix.os }} / Python ${{ matrix.python }}
Expand All @@ -17,14 +21,20 @@ jobs:
os: [windows-2022, ubuntu-22.04]
python: ['3.10', '3.12']
runs-on: ${{ matrix.os }}
timeout-minutes: 20
env:
QT_QPA_PLATFORM: offscreen
PACE_CONTROLLER_DATA_DIR: ${{ runner.temp }}/pace-controller-data
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: cross_platform/requirements-dev.txt
cache-dependency-path: |
cross_platform/requirements*.txt
cross_platform/pyproject.toml

- name: Install Linux Qt runtime libraries
if: runner.os == 'Linux'
Expand All @@ -34,7 +44,7 @@ jobs:

- name: Install application and tests
working-directory: cross_platform
run: python -m pip install -e . -r requirements-dev.txt
run: python -m pip install -e . -r requirements-ci.txt

- name: Compile and test
working-directory: cross_platform
Expand Down
93 changes: 31 additions & 62 deletions .github/workflows/cross-platform-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,14 @@ concurrency:
cancel-in-progress: false

jobs:
screenshot:
name: Render real PySide6 screenshot
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0

- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: pip
cache-dependency-path: cross_platform/requirements.txt

- name: Install Qt runtime libraries
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libxkbcommon-x11-0 libdbus-1-3 libfontconfig1 libxcb-cursor0 libxcb-xkb1 libxcb-image0 libxcb-icccm4 libxcb-render-util0 libxcb-keysyms1 libxcb-shape0 libxcb-randr0 libxcb-xfixes0

- name: Render and validate the current real interface
working-directory: cross_platform
env:
QT_QPA_PLATFORM: offscreen
PACE_CONTROLLER_DATA_DIR: ${{ runner.temp }}/pace-controller-data
run: |
python -m pip install .
python -m pace_controller --language en --screenshot docs/pace_controller_gui.png
python -c "from PySide6.QtGui import QImage; i=QImage('docs/pace_controller_gui.png'); assert not i.isNull() and i.width() >= 1000 and i.height() >= 700, (i.width(), i.height())"

- name: Commit the real screenshot
shell: bash
run: |
set -euo pipefail
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add cross_platform/docs/pace_controller_gui.png
if ! git diff --cached --quiet; then
git commit -m 'Update real cross-platform interface screenshot [skip ci]'
git fetch origin main
git rebase origin/main
git push origin HEAD:main
fi

prepare:
if: github.actor != 'github-actions[bot]' || github.event_name == 'workflow_dispatch'
needs: screenshot
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
QT_QPA_PLATFORM: offscreen
PACE_CONTROLLER_DATA_DIR: ${{ runner.temp }}/pace-controller-data
PYTHONPATH: cross_platform/src
outputs:
version: ${{ steps.prepare.outputs.version }}
commit_sha: ${{ steps.commit.outputs.commit_sha }}
Expand All @@ -79,23 +39,15 @@ jobs:
with:
python-version: '3.12'
cache: pip
cache-dependency-path: cross_platform/requirements-dev.txt
cache-dependency-path: |
cross_platform/requirements*.txt
cross_platform/pyproject.toml

- name: Install test and manual dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-xetex texlive-latex-extra texlive-fonts-recommended libegl1 libgl1 libxkbcommon0 libxkbcommon-x11-0 libdbus-1-3 libfontconfig1 libxcb-cursor0 libxcb-xkb1 libxcb-image0 libxcb-icccm4 libxcb-render-util0 libxcb-keysyms1 libxcb-shape0 libxcb-randr0 libxcb-xfixes0
python -m pip install -r cross_platform/requirements-dev.txt

- name: Validate source before release
env:
QT_QPA_PLATFORM: offscreen
PACE_CONTROLLER_DATA_DIR: ${{ runner.temp }}/pace-controller-data
run: |
python tests/test_project.py
python -m pytest -q cross_platform/tests
python -m compileall -q cross_platform/src
python -c "from pathlib import Path; import hashlib; data=Path('PACE_Controller.ps1').read_bytes().replace(b'\r\n', b'\n'); assert hashlib.sha256(data).hexdigest() == 'aa6ffe5431dfab7d2ea998f9b59e8ac5163b0e3478e84a3c15e2e826fb356b8e'"
python -m pip install -r cross_platform/requirements-ci.txt

- name: Prepare semantic version and metadata
id: prepare
Expand All @@ -104,6 +56,11 @@ jobs:
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Preparing PACE Controller v$VERSION"

- name: Render and validate the versioned interface
run: |
python -m pace_controller --language en --screenshot cross_platform/docs/pace_controller_gui.png
python -c "from PySide6.QtGui import QImage; i=QImage('cross_platform/docs/pace_controller_gui.png'); assert not i.isNull() and i.width() >= 1000 and i.height() >= 700, (i.width(), i.height())"

- name: Build versioned PDF manual
run: |
pandoc cross_platform/docs/PACE_Controller_Manual.md \
Expand All @@ -118,9 +75,9 @@ jobs:
VERSION="${{ steps.prepare.outputs.version }}"
python tests/test_project.py
python -m pytest -q cross_platform/tests
python -m compileall -q cross_platform/src
python - <<'PY'
from pathlib import Path
import re

version = "${{ steps.prepare.outputs.version }}"
init = Path("cross_platform/src/pace_controller/__init__.py").read_text(encoding="utf-8")
Expand All @@ -142,8 +99,6 @@ jobs:
git add README.md CITATION.cff CHANGELOG.md cross_platform
if ! git diff --cached --quiet; then
git commit -m "Prepare cross-platform v${VERSION} release"
git fetch origin main
git rebase origin/main
git push origin HEAD:main
fi
echo "commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
Expand All @@ -164,6 +119,7 @@ jobs:
name: Windows executable (x86_64)
needs: prepare
runs-on: windows-2022
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -173,7 +129,9 @@ jobs:
with:
python-version: '3.12'
cache: pip
cache-dependency-path: cross_platform/requirements-dev.txt
cache-dependency-path: |
cross_platform/requirements*.txt
cross_platform/pyproject.toml

- name: Build standalone executable
shell: powershell
Expand All @@ -192,11 +150,14 @@ jobs:
name: pace-controller-windows
path: cross_platform/dist/PACE-Controller-v${{ needs.prepare.outputs.version }}-Windows-x86_64.exe
if-no-files-found: error
compression-level: 0
retention-days: 7

linux-exe:
name: Linux executable (x86_64)
needs: prepare
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -206,7 +167,9 @@ jobs:
with:
python-version: '3.12'
cache: pip
cache-dependency-path: cross_platform/requirements-dev.txt
cache-dependency-path: |
cross_platform/requirements*.txt
cross_platform/pyproject.toml

- name: Install Linux build libraries
run: |
Expand All @@ -229,11 +192,14 @@ jobs:
name: pace-controller-linux
path: cross_platform/dist/PACE-Controller-v${{ needs.prepare.outputs.version }}-Linux-x86_64.tar.gz
if-no-files-found: error
compression-level: 0
retention-days: 7

source-package:
name: Source archive and manual
needs: prepare
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -261,11 +227,14 @@ jobs:
PACE-Controller-v${{ needs.prepare.outputs.version }}-source.zip
PACE_Controller_Manual.pdf
if-no-files-found: error
compression-level: 0
retention-days: 7

publish:
name: Publish GitHub release
needs: [prepare, windows-exe, linux-exe, source-package]
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/download-artifact@v7
with:
Expand Down
2 changes: 2 additions & 0 deletions cross_platform/requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
pytest==8.3.5