From 5b021fc49037bf7b0f17b3f8b6d4dbb2ecdab40a Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 12 Oct 2024 09:58:52 +0200 Subject: [PATCH] Github actions workflow --- .github/workflows/ci.yaml | 83 +++++++++++++++++++++++++++++++++++++++ README.md | 12 +++--- 2 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..87f418e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,83 @@ +name: Build KRunner Plugins + +on: + push: + branches: + - master + - github_actions + pull_request: + branches: + - master + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: + - name: ubuntu + image: ubuntu:22.04 + - name: opensuse + image: opensuse/tumbleweed + - name: fedora + image: fedora + plasma_version: [plasma5, plasma6] + + runs-on: ubuntu-latest + container: ${{ matrix.os.image }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies (Ubuntu) + if: matrix.os.name == 'ubuntu' + run: | + apt install software-properties-common + apt-add-repository 'deb http://archive.neon.kde.org/user bionic main' + wget -qO - 'http://archive.neon.kde.org/public.key' | apt-key add - + if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then + apt install -y git cmake extra-cmake-modules build-essential libkf5runner-dev qtdeclarative5-dev gettext libxdo-dev libkf5kcmutils-dev libkf5dbusaddons-bin + else + apt install -y git cmake extra-cmake-modules build-essential libkf6runner-dev libxdo-dev libkf6kcmutils-dev kf6-kdbusaddons + fi + + - name: Install dependencies (OpenSUSE) + if: matrix.os.name == 'opensuse' + run: | + zypper refresh + if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then + zypper install -y git cmake extra-cmake-modules ki18n-devel krunner-devel kconfigwidgets-devel kcmutils-devel gettext-tools xdotool-devel kdbusaddons-tools + else + zypper install -y git cmake kf6-extra-cmake-modules kf6-ki18n-devel kf6-krunner-devel gettext-tools xdotool-devel kf6-kconfigwidgets-devel kf6-kcmutils-devel kf6-kdbusaddons-tools + fi + + - name: Install dependencies (Fedora) + if: matrix.os.name == 'fedora' + run: | + dnf install -y git cmake extra-cmake-modules + if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then + dnf install -y kf5-ki18n-devel kf5-krunner-devel gettext xdotool kf5-kcmutils-devel + else + dnf install -y kf6-ki18n-devel kf6-krunner-devel kf6-kcmutils-devel gettext xdotool + fi + + - name: Create build directory + run: | + mkdir -p build + cd build + + - name: Build with CMake + run: | + cd build + if [[ "${{ matrix.plasma_version }}" == "plasma6" ]]; then + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON + else + cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=OFF + fi + cmake --build . + + - name: Run tests + run: | + cd build + ctest --output-on-failure + diff --git a/README.md b/README.md index 7a747aa..534c971 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ but having the library installed is recommended. Debian/Ubuntu Plasma5: -```bash +```bash install-ubuntu-plasma5 sudo apt install git cmake extra-cmake-modules build-essential libkf5runner-dev qtdeclarative5-dev gettext libxdo-dev libkf5kcmutils-dev libkf5dbusaddons-bin ``` Plasma6: -```bash +```bash install-ubuntu-plasma6 sudo apt install git cmake extra-cmake-modules build-essential libkf6runner-dev libxdo-dev libkf6kcmutils-dev kf6-kdbusaddons ``` @@ -32,11 +32,11 @@ sudo apt install git cmake extra-cmake-modules build-essential libkf6runner-dev OpenSUSE Plasma5: -```bash +```bash install-opensuse-plasma5 sudo zypper install git cmake extra-cmake-modules ki18n-devel krunner-devel kconfigwidgets-devel kcmutils-devel gettext-tools xdotool-devel kdbusaddons-tools ``` Plasma6: -```bash +```bash install-opensuse-plasma6 sudo zypper install git cmake kf6-extra-cmake-modules kf6-ki18n-devel kf6-krunner-devel gettext-tools xdotool-devel kf6-kconfigwidgets-devel kf6-kcmutils-devel kf6-kdbusaddons-tools ``` @@ -46,11 +46,11 @@ sudo zypper install git cmake kf6-extra-cmake-modules kf6-ki18n-devel kf6-krunne Fedora Plasma5: -```bash +```bash install-fedora-plasma5 sudo dnf install git cmake extra-cmake-modules kf5-ki18n-devel kf5-krunner-devel gettext xdotool kf5-kcmutils-devel ``` Plasma6: -```bash +```bash install-fedora-plasma6 sudo dnf install git cmake extra-cmake-modules kf6-ki18n-devel kf6-krunner-devel kf6-kcmutils-devel gettext xdotool ```