Github actions workflow #5
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: Build KRunner Plugins | |
on: | |
push: | |
branches: | |
- master | |
- github_actions | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, opensuse/tumbleweed, fedora] | |
plasma_version: [plasma5, plasma6] | |
runs-on: ubuntu-latest | |
container: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu' | |
run: | | |
sudo apt update | |
if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then | |
sudo apt install -y git cmake extra-cmake-modules build-essential libkf5runner-dev qtdeclarative5-dev gettext libxdo-dev libkf5kcmutils-dev libkf5dbusaddons-bin | |
else | |
sudo 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 == 'opensuse' | |
run: | | |
sudo zypper refresh | |
if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then | |
sudo zypper install -y git cmake extra-cmake-modules ki18n-devel krunner-devel kconfigwidgets-devel kcmutils-devel gettext-tools xdotool-devel kdbusaddons-tools | |
else | |
sudo 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 == 'fedora' | |
run: | | |
sudo dnf install -y git cmake extra-cmake-modules | |
if [ "${{ matrix.plasma_version }}" == "plasma5" ]; then | |
sudo dnf install -y kf5-ki18n-devel kf5-krunner-devel gettext xdotool kf5-kcmutils-devel | |
else | |
sudo 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 | |
cmake .. -DCMAKE_BUILD_TYPE=Release | |
cmake --build . | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure | |