Add cmake building system #963
This file contains hidden or 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 Linux/macOS | |
| on: | |
| push: | |
| branches: | |
| - 'testing_*' | |
| pull_request: | |
| branches: | |
| - 'testing_*' | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| ubuntu-build-qt5: | |
| name: Ubuntu CI QT5 | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04, ubuntu-26.04] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install build-essential cmake pkg-config libhamlib-dev libsqlite3-dev qtbase5-dev qtbase5-dev-tools qttools5-dev-tools libqt5charts5-dev qttools5-dev-tools qt5keychain-dev qtwebengine5-dev libqt5serialport5-dev libqt5websockets5-dev | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: configure | |
| run: cmake -DUSE_QT6=OFF . | |
| - name: make | |
| run: make | |
| ubuntu-build-qt6: | |
| name: Ubuntu CI QT6 | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, ubuntu-26.04] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install build-essential cmake pkg-config libhamlib-dev libsqlite3-dev qt6-base-dev qt6-tools-dev qtkeychain-qt6-dev qt6-webengine-dev qt6-charts-dev qt6-serialport-dev qt6-svg-dev qt6-websockets-dev | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: configure | |
| run: cmake . | |
| - name: make | |
| run: make | |
| macos-build: | |
| name: MacOS CI | |
| if: vars.ENABLE_MACOS == 'true' | |
| strategy: | |
| matrix: | |
| os: [macos-15] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| unset HOMEBREW_NO_INSTALL_FROM_API | |
| brew update | |
| brew upgrade || true | |
| brew install qt6 | |
| brew link qt6 --force | |
| brew install hamlib | |
| brew link hamlib --force | |
| brew install qtkeychain | |
| brew install dbus-glib | |
| brew install brotli | |
| brew install icu4c | |
| brew install pkg-config | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from tag | |
| run : | | |
| TAGVERSION=$(git describe --tags) | |
| echo "TAGVERSION=${TAGVERSION:1}" >> $GITHUB_ENV | |
| - name: Configure and compile | |
| run: | | |
| cd build | |
| qmake6 -config release .. | |
| make -j4 | |
| deb-package: | |
| name: DEB Package Build | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install tools and build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install devscripts equivs dpkg-dev fakeroot lintian libconfig-model-dpkg-perl licensecheck | |
| sudo mk-build-deps --install --remove debian/control --tool "apt-get -y --no-install-recommends" | |
| - name: Check debian/copyright | |
| run: cme check dpkg-copyright | |
| - name: Build DEB package | |
| run: dpkg-buildpackage -b -us -uc -j4 | |
| - name: Verify DEB was created | |
| run: ls -la ../qlog_*.deb | |
| - name: Run lintian | |
| run: lintian --no-tag-display-limit --fail-on error ../qlog_*.changes | |
| - name: Upload DEB artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: deb-package | |
| path: /home/runner/work/QLog/qlog_*.deb | |
| retention-days: 1 | |
| deb-smoke-test: | |
| name: DEB Smoke Test | |
| needs: deb-package | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download DEB artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: deb-package | |
| - name: Install and smoke test | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ./qlog_*.deb | |
| QT_QPA_PLATFORM=offscreen qlog --help 2>&1 | grep -q "QLog Help" | |
| rpm-package: | |
| name: RPM Package Build | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:43 | |
| steps: | |
| - name: Install base tools | |
| run: dnf install -y git rpm-build rpmdevtools rpmlint dnf-plugins-core | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from tag | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//') | |
| echo "REPO_VERSION=${VERSION}" >> $GITHUB_ENV | |
| - name: Install build dependencies from spec | |
| run: dnf builddep -y rpm_spec/qlog.spec | |
| - name: Prepare RPM build tree | |
| run: | | |
| rpmdev-setuptree | |
| TAR_DIR="QLog-${REPO_VERSION}" | |
| mkdir -p "/tmp/${TAR_DIR}" | |
| cp -a . "/tmp/${TAR_DIR}/" | |
| tar czf ~/rpmbuild/SOURCES/qlog-${REPO_VERSION}.tar.gz --exclude='.git' -C /tmp "${TAR_DIR}" | |
| - name: Build RPM package | |
| run: rpmbuild -bb rpm_spec/qlog.spec | |
| - name: Verify RPM was created | |
| run: ls -la ~/rpmbuild/RPMS/*/QLog-*.rpm | |
| - name: Run rpmlint | |
| run: rpmlint ~/rpmbuild/RPMS/*/*.rpm || true | |
| - name: Upload RPM artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: rpm-package | |
| path: ~/rpmbuild/RPMS/*/QLog-*.rpm | |
| retention-days: 1 | |
| rpm-smoke-test: | |
| name: RPM Smoke Test | |
| needs: rpm-package | |
| runs-on: ubuntu-latest | |
| container: | |
| image: fedora:43 | |
| steps: | |
| - name: Download RPM artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: rpm-package | |
| - name: Install and smoke test | |
| run: | | |
| dnf install -y $(find . -name 'QLog-*.rpm') | |
| QT_QPA_PLATFORM=offscreen qlog --help 2>&1 | grep -q "QLog Help" |