Skip to content

Commit

Permalink
CI: Add static/shared and python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Nov 12, 2023
1 parent 4e3634f commit cf23f70
Showing 1 changed file with 50 additions and 14 deletions.
64 changes: 50 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

name: CI

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
Expand All @@ -14,34 +20,60 @@ jobs:
matrix:
os:
- ubuntu-22.04
- ubuntu-20.04
- windows-2022
- windows-2019
- macos-12
- macos-11

build_type:
- Debug
- Release
qt:
- version: "5.15.2"
requested: "5.15"
- version: "6.3.2" # Qt 6.3 is not an LTS version, so '6.3.*' always resolves to '6.3.2'
requested: "6.3.*"

link_type:
- shared
- static

config:
- qt_version: "5.15"
- qt_version: "6.3.*"

include:
- os: ubuntu-22.04
build_type: Debug
link_type: shared
config:
qt_version: "6.6.0"
apt_pgks:
- llvm
pip_pgks:
- shiboken6-generator==6.6.0 pyside6==6.6.0

steps:
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v3
with:
aqtversion: null # use whatever the default is
modules: ${{ matrix.qt.modules }}
version: ${{ matrix.qt.requested }}
version: ${{ matrix.config.qt_version }}
cache: true

- name: Checkout sources
uses: actions/checkout@v4

- name: Create build directory
run: mkdir build
- name: Install dependencies on Ubuntu (${{ join(matrix.config.apt_pgks, ' ') }})
if: ${{ runner.os == 'Linux' && matrix.config.apt_pgks }}
run: |
sudo apt update -qq
echo ${{ join(matrix.config.apt_pgks, ' ') }} | xargs sudo apt install -y
- name: Install Python dependencies (${{ join(matrix.config.pip_pgks, ' ') }})
if: ${{ matrix.config.pip_pgks }}
run: echo ${{ join(matrix.config.pip_pgks, ' ') }} | xargs pip install

- name: Hackery due Shiboken hardcoded paths
if: ${{ matrix.config.pip_pgks }}
run: |
sudo mkdir -p /opt/rh/gcc-toolset-10/root/usr/bin/
sudo cp /usr/bin/g++-10 /opt/rh/gcc-toolset-10/root/usr/bin/c++
sudo mkdir -p /opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-linux-gnu/10/
sudo cp /usr/lib/gcc/x86_64-linux-gnu/10/cc1plus /opt/rh/gcc-toolset-10/root/usr/lib/gcc/x86_64-linux-gnu/10/
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main
Expand All @@ -52,11 +84,15 @@ jobs:
- name: Configure project
run: >
cmake -S . -B ./build -G Ninja
--warn-uninitialized -Werror=dev
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DKDChart_QT6=${{ startsWith(matrix.qt.version, '6.') }}
-DKDChart_QT6=${{ startsWith(matrix.config.qt_version, '6.') }}
-DKDChart_TESTS=${{ matrix.build_type == 'Debug' }}
-DKDChart_STATIC=${{ matrix.link_type == 'static' }}
-DKDChart_EXAMPLES=${{ matrix.build_type == 'Debug' }}
-DKDChart_DOCS=${{ matrix.build_type == 'Debug' && runner.os == 'Linux' }}
-DKDChart_PYTHON_BINDINGS=${{ matrix.config.pip_pgks }}
-DPython3_FIND_VIRTUALENV=ONLY
- name: Build Project
run: cmake --build ./build
Expand Down

0 comments on commit cf23f70

Please sign in to comment.