CI Tests #231
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
name: CI Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- '*' | |
schedule: | |
- cron: '0 2 * * 1' | |
jobs: | |
Ubuntu: | |
runs-on: ubuntu-24.04 | |
name: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
QT_VER: [5.15.2, 6.7.2] | |
env: | |
QWT_VER: 6.3.0 | |
steps: | |
- name: Get Processor Info | |
run : | | |
lscpu | grep name | |
nproc | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Restore cached Qt | |
id: cache-qt | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/Qt | |
key: ${{ runner.os }}-Qt-${{ matrix.QT_VER }}-Cache | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
setup-python: false | |
version: ${{ matrix.QT_VER }} | |
cache: ${{ steps.cache-qt.outputs.cache-hit }} | |
dir: ${{ github.workspace }}/Qt | |
archives: qtbase qtsvg qttools qttranslations icu | |
aqtversion: '==3.1.*' | |
- name: Install prerequisties | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends \ | |
libglu1-mesa-dev \ | |
libmuparser-dev \ | |
libgsl-dev \ | |
libgl2ps-dev \ | |
libgtest-dev \ | |
libxcb-xinput0 \ | |
libxcb-xkb1 \ | |
libxkbcommon-x11-0 \ | |
xvfb | |
if [[ "${{ matrix.QT_VER }}" != "5.15.2" ]]; then | |
sudo apt install -y --no-install-recommends \ | |
libxkbcommon-dev \ | |
libxcb-cursor0 \ | |
libvulkan-dev | |
fi | |
- name: Get GCC version | |
id: gcc-version | |
run: | |
echo "gcc_version=$(gcc -dumpversion)" >> $GITHUB_OUTPUT | |
- name: Restore cached Qwt | |
id: cache-qwt | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/Qwt | |
key: ${{ runner.os }}-Qwt-${{ env.QWT_VER }}-Qt-${{ matrix.QT_VER }}-gcc-${{ steps.gcc-version.outputs.gcc_version }} | |
- name: Build and install Qwt | |
if: steps.cache-qwt.outputs.cache-hit != 'true' | |
run: | | |
wget https://downloads.sourceforge.net/qwt/qwt-${{ env.QWT_VER }}.tar.bz2 | |
tar -xf qwt-${{ env.QWT_VER }}.tar.bz2 && cd qwt-${{ env.QWT_VER }} | |
sed -i "s|= \/usr\/local\/qwt-\$\$QWT\_VERSION|= ${GITHUB_WORKSPACE}/Qwt|g" qwtconfig.pri | |
sed -i "s|QWT_CONFIG += QwtDesigner'||g" qwtconfig.pri | |
sed -i "s|QWT_CONFIG += QwtExamples||g" qwtconfig.pri | |
sed -i "s|QWT_CONFIG += QwtPlayground||g" qwtconfig.pri | |
sed -i "s|QWT_CONFIG += QwtTests||g" qwtconfig.pri | |
qmake qwt.pro | |
make -j$(nproc) | |
make install | |
- name: Install Python packages | |
run: | | |
pip3 install sip pyqt-builder numpy | |
if [[ "${{ matrix.QT_VER }}" == "5.15.2" ]]; then | |
pip3 install pyqt5 | |
else | |
pip3 install pyqt6 | |
fi | |
- name: Configuring | |
run: | | |
cmake \ | |
--preset default \ | |
-DMAKHBER_SEARCH_FOR_UPDATES=OFF \ | |
-DMAKHBER_DOWNLOAD_LINKS=OFF \ | |
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/Qwt | |
- name: Building | |
run: | | |
xvfb-run cmake --build --preset default -j$(nproc) | |
- name: Testing | |
run: | | |
xvfb-run -a ctest --preset default --repeat until-pass:3 | |
MSVC: | |
name: MSVC 2022 | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
QT_VER: [5.15.2, 6.7.2] | |
env: | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
VCPKG_DEFAULT_TRIPLET: x64-windows | |
QWT_VER: 6.3.0 | |
steps: | |
- name: Get Processor Info | |
run : | | |
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Restore cached Qt | |
id: cache-qt | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/Qt | |
key: ${{ runner.os }}-Qt-${{ matrix.QT_VER }}-Cache | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
setup-python: false | |
version: ${{ matrix.QT_VER }} | |
cache: ${{ steps.cache-qt.outputs.cache-hit }} | |
dir: ${{ github.workspace }}/Qt | |
archives: qtbase qtsvg qttools qttranslations | |
aqtversion: '==3.1.*' | |
- name: Restore cached Qwt | |
id: cache-qwt | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/Qwt | |
key: ${{ runner.os }}-Qwt-${{ env.QWT_VER }}-Qt-${{ matrix.QT_VER }} | |
- uses: ilammy/msvc-dev-cmd@v1 | |
if: steps.cache-qwt.outputs.cache-hit != 'true' | |
- name: Build and install Qwt | |
if: steps.cache-qwt.outputs.cache-hit != 'true' | |
run: | | |
choco install wget jom | |
wget https://downloads.sourceforge.net/qwt/qwt-${{ env.QWT_VER }}.zip | |
Expand-Archive qwt-${{ env.QWT_VER }}.zip -DestinationPath .; cd qwt-${{ env.QWT_VER }} | |
((Get-Content -path qwtconfig.pri -Raw) ` | |
-replace 'C:/Qwt-\$\$QWT_VERSION',"$Env:GITHUB_WORKSPACE/Qwt" ` | |
-replace 'QWT_CONFIG \+= QwtDesigner',"" ` | |
-replace 'QWT_CONFIG \+= QwtExamples',"" ` | |
-replace 'QWT_CONFIG \+= QwtPlayground',"" ` | |
-replace 'QWT_CONFIG \+= QwtTests',"") ` | |
| Set-Content -Path .\qwtconfig.pri | |
qmake qwt.pro | |
jom /J "$Env:NUMBER_OF_PROCESSORS" | |
jom install | |
- name: Setup NuGet Credentials | |
run: | | |
& $(vcpkg fetch nuget | select -last 1) sources add ` | |
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" ` | |
-name "GitHub" ` | |
-username ${{ github.repository_owner }} ` | |
-password "${{ secrets.GITHUB_TOKEN }}" | |
- name: vcpkg package restore | |
run: | | |
cd $Env:VCPKG_INSTALLATION_ROOT | |
git pull origin master | |
vcpkg install zlib gsl muparser liborigin opengl gl2ps gtest pkgconf | |
- name: Install Python packages | |
run: | | |
pip install sip pyqt-builder numpy | |
if ("${{ matrix.QT_VER }}" -eq "5.15.2") { | |
pip install pyqt5 | |
} else { | |
pip install pyqt6 | |
} | |
- name: Configuring | |
run: | | |
cmake ` | |
--preset msvc-vcpkg ` | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` | |
-DCMAKE_SYSTEM_VERSION="10.0" ` | |
-DPython3_ROOT_DIR=${{ env.pythonLocation }} ` | |
-DCMAKE_PREFIX_PATH="$Env:GITHUB_WORKSPACE\Qwt" ` | |
-DBUILD_SHARED_LIBS=ON | |
- name: Building | |
run: | | |
cmake --build --preset msvc-vcpkg --config RelWithDebInfo | |
- name: Testing | |
run: | | |
$Env:PATH = "$Env:GITHUB_WORKSPACE\Qwt\lib;$Env:PATH" | |
ctest --preset msvc-vcpkg -C RelWithDebInfo --repeat until-pass:3 | |
macos: | |
runs-on: macos-${{ matrix.macos_ver }} | |
name: macos | |
strategy: | |
fail-fast: false | |
matrix: | |
QT_VER: [5, 6] | |
macos_ver: [13, 14] | |
env: | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
steps: | |
- name: Get Processor Info | |
run : | | |
sysctl -n machdep.cpu.brand_string | |
sysctl -n hw.logicalcpu | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install prerequisties | |
run: | | |
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done | |
brew update | |
brew install --display-times muparser liborigin gsl gl2ps googletest | |
if [[ "${{ matrix.QT_VER }}" == "5" ]]; then | |
brew install qwt-qt5 | |
else | |
brew install qwt | |
fi | |
- name: Configuring | |
run: | | |
if [[ "${{ matrix.QT_VER }}" == "5" ]]; then | |
export PATH=$(brew --prefix)/opt/qt@5/bin:$PATH | |
QWT_PATH=$(brew --prefix)/opt/qwt-qt5 | |
fi | |
cmake \ | |
--preset macos \ | |
-DCMAKE_PREFIX_PATH=${QWT_PATH} | |
- name: Building | |
run: | | |
cmake --build --preset default -j$(sysctl -n hw.logicalcpu) | |
- name: Testing | |
run: | | |
ctest --preset default --repeat until-pass:3 |