Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions #46

Merged
merged 7 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
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
name: ${{ matrix.os.name }}-${{ matrix.plasma_version }}
container:
image: ${{ matrix.os.image }}
options: --user root
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
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=RelWithDebInfo -DBUILD_WITH_QT6=ON
else
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_WITH_QT6=OFF
fi
cmake --build .
cmake --install .

- name: Run tests
run: |
cd build
ctest -V

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMDeprecationSettings)

include(KDEClangFormat)

# Find the required Libaries
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets Core Xml Network)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ If you like this plugin you can check out [the dolphin version](https://github.c
<summary><b>Debian/Ubuntu</b></summary>

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
```

Expand All @@ -55,12 +55,12 @@ sudo apt install git cmake extra-cmake-modules build-essential libkf6runner-dev
<summary><b>OpenSUSE</b></summary>

Plasma5:
```bash
sudo zypper install git cmake extra-cmake-modules ki18n-devel krunner-devel kcmutils-devel kio-devel kservice-devel kdbusaddons-tools
```bash install-opensuse-plasma5
sudo zypper install git cmake extra-cmake-modules ki18n-devel krunner-devel kcmutils-devel kio-devel kservice-devel kdbusaddons-tools libQt5Test-devel
```
Plasma6:
```bash
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
```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 qt6-test-devel
```

</details>
Expand All @@ -69,11 +69,11 @@ sudo zypper install git cmake kf6-extra-cmake-modules kf6-ki18n-devel kf6-krunne
<summary><b>Fedora</b></summary>

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
```

Expand Down
1 change: 1 addition & 0 deletions autotests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS

ecm_add_test(jetbrainsrunnerintegrationtest.cpp LINK_LIBRARIES Qt::Test KF${QT_MAJOR_VERSION}::Runner KF${QT_MAJOR_VERSION}::Service)
krunner_configure_test(jetbrainsrunnerintegrationtest krunner_jetbrainsrunner)
set_tests_properties(jetbrainsrunnerintegrationtest PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")

if (COMMAND krunner_configure_test)
krunner_configure_test(jetbrainsrunnerintegrationtest krunner_jetbrainsrunner)
Expand Down
5 changes: 5 additions & 0 deletions autotests/jetbrainsrunnerintegrationtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QDir>
#include <QStandardPaths>
#include <QTest>
#include <kservice_version.h>

using namespace KRunner;

Expand All @@ -15,6 +16,10 @@ private Q_SLOTS:
{
using QSP = QStandardPaths;
QSP::setTestModeEnabled(true);
#if KSERVICE_VERSION_MAJOR == 6
KSycoca::self()->setupTestMenu();
#endif

const QString dataLocation = QSP::writableLocation(QStandardPaths::ApplicationsLocation);
QDir(dataLocation).removeRecursively();
const QString configLocation = QSP::writableLocation(QStandardPaths::GenericConfigLocation) + "/JetBrains/PhpStorm2022.2/options/";
Expand Down
2 changes: 1 addition & 1 deletion src/jetbrains-api