From a4d638ff4a696307d5ca3d30a46c9b48fa7d5290 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 12 Oct 2024 17:25:19 +0200 Subject: [PATCH] Add github action Same as for the EmojiRunner --- .github/workflows/ci.yaml | 91 +++++++++++++++++++++++++++++++++++++++ README.md | 12 +++--- 2 files changed, 97 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..562cc74 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,91 @@ +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: invent-registry.kde.org/neon/docker-images/plasma:user + - name: ubuntu + image: ubuntu:24.04 + - name: opensuse + image: opensuse/tumbleweed + - name: fedora + image: fedora + plasma_version: [plasma5, plasma6] + exclude: + - os: + image: invent-registry.kde.org/neon/docker-images/plasma:user + plasma_version: plasma5 + - os: + image: ubuntu:24.04 + plasma_version: plasma6 + + runs-on: ubuntu-latest + container: + image: ${{ matrix.os.image }} + options: --user root + steps: + - uses: actions/checkout@v4 + with: + sparse: | + README.md + + - name: Install dependencies + shell: bash + run: | + echo "Dependencies for install-${{ matrix.os.name }}-${{ matrix.plasma_version }}" + CMD=$(sed -n '/```bash install-${{ matrix.os.name }}-${{ matrix.plasma_version }}/,/```/p' README.md | head -n -1 | tail -n +2 |sed 's/sudo //') + if [[ "${{ matrix.os.name }}" == "ubuntu" ]]; then + apt update + export DEBIAN_FRONTEND=noninteractive + echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf + elif [[ "${{ matrix.os.name }}" == "fedora" ]]; then + echo "defaultyes=True" >> /etc/dnf/dnf.conf + elif [[ "${{ matrix.os.name }}" == "opensuse" ]]; then + zypper refresh + CMD=$(echo $CMD | sed 's/zypper/zypper --non-interactive/') + else + echo "Unsupported OS: ${{ matrix.os.name }}" + exit 1 + fi + echo "$CMD" + eval $CMD + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Create build directory + run: | + mkdir -p build + cd build + + - name: Build and install + shell: bash + 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 . + cmake --install . + + - name: Run tests + run: | + cd build + ctest --output-on-failure + diff --git a/README.md b/README.md index d153554..4048b45 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,11 @@ If you like this plugin you can check out [the dolphin version](https://github.c Debian/Ubuntu Plasma5: -```bash +```bash install-ubuntu-plasma5 sudo apt install git cmake extra-cmake-modules build-essential libkf5runner-dev libkf5i18n-dev libkf5kio-dev libkf5service-dev libkf5kcmutils-dev qtdeclarative5-dev libkf5dbusaddons-bin ``` Plasma6: -```bash +```bash install-ubuntu-plasma6 sudo apt install git cmake extra-cmake-modules build-essential libkf6runner-dev libkf6i18n-dev libkf6kio-dev libkf6service-dev libkf6kcmutils-dev kf6-kdbusaddons ``` @@ -55,11 +55,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 kcmutils-devel kio-devel kservice-devel kdbusaddons-tools ``` Plasma6: -```bash +```bash install-opensuse-plasma6 sudo zypper install git cmake kf6-extra-cmake-modules kf6-ki18n-devel kf6-krunner-devel kf6-kcmutils-devel kf6-kio-devel kf6-kservice-devel kf6-kdbusaddons-tools ``` @@ -69,11 +69,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 kf5-kcmutils-devel kf5-kio-devel kf5-kservice-devel ``` Plasma6: -```bash +```bash install-fedora-plasma6 sudo dnf install git cmake extra-cmake-modules kf6-ki18n-devel kf6-krunner-devel kf6-kcmutils-devel kf6-kio-devel kf6-kservice-devel ```