mirror of
https://github.com/redstrate/Novus.git
synced 2025-05-19 14:47:46 +00:00
105 lines
5.1 KiB
YAML
105 lines
5.1 KiB
YAML
name: Main
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest]
|
|
build_type: [Release]
|
|
c_compiler: [gcc, cl]
|
|
include:
|
|
- os: windows-latest
|
|
c_compiler: cl
|
|
cpp_compiler: cl
|
|
- os: ubuntu-latest
|
|
c_compiler: gcc
|
|
cpp_compiler: g++
|
|
exclude:
|
|
- os: windows-latest
|
|
c_compiler: gcc
|
|
|
|
steps:
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: "6.6.*"
|
|
cache: true
|
|
|
|
- name: Set reusable strings
|
|
id: strings
|
|
shell: bash
|
|
run: |
|
|
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
|
echo "prefix-dir=${{ github.workspace }}/prefix" >> "$GITHUB_OUTPUT"
|
|
|
|
# Why does Windows need this?
|
|
- name: Clear old build directiories
|
|
if: ${{ matrix.os }} == 'windows-latest'
|
|
run: |
|
|
rmdir ${{ steps.strings.outputs.build-output-dir }}-ECM /s /q
|
|
rmdir ${{ steps.strings.outputs.build-output-dir }}-kca /s /q
|
|
rmdir ${{ steps.strings.outputs.build-output-dir }}-kconfig /s /q
|
|
rmdir ${{ steps.strings.outputs.build-output-dir }}-karchive /s /q
|
|
|
|
- name: Build and install Extra CMake Modules
|
|
run: |
|
|
git clone https://invent.kde.org/frameworks/extra-cmake-modules.git
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}-ECM -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S extra-cmake-modules -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF
|
|
cmake --build ${{ steps.strings.outputs.build-output-dir }}-ECM
|
|
cmake --install ${{ steps.strings.outputs.build-output-dir }}-ECM
|
|
|
|
- name: Build and install KCoreAddons
|
|
run: |
|
|
git clone https://invent.kde.org/frameworks/kcoreaddons.git
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}-kca -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S kcoreaddons -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF
|
|
cmake --build ${{ steps.strings.outputs.build-output-dir }}-kca
|
|
cmake --install ${{ steps.strings.outputs.build-output-dir }}-kca
|
|
|
|
- name: Build and install KConfig
|
|
run: |
|
|
git clone https://invent.kde.org/frameworks/kconfig.git
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}-kconfig -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S kconfig -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF
|
|
cmake --build ${{ steps.strings.outputs.build-output-dir }}-kconfig
|
|
cmake --install ${{ steps.strings.outputs.build-output-dir }}-kconfig
|
|
|
|
- name: Build and install KArchive
|
|
run: |
|
|
git clone https://invent.kde.org/frameworks/karchive.git
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}-karchive -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S karchive -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF
|
|
cmake --build ${{ steps.strings.outputs.build-output-dir }}-karchive
|
|
cmake --install ${{ steps.strings.outputs.build-output-dir }}-karchive
|
|
|
|
- name: Build and install KI18n
|
|
run: |
|
|
git clone https://invent.kde.org/frameworks/ki18n.git
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}-ki18n -DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ki18n -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF
|
|
cmake --build ${{ steps.strings.outputs.build-output-dir }}-ki18n
|
|
cmake --install ${{ steps.strings.outputs.build-output-dir }}-ki18n
|
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Configure CMake
|
|
run: >
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
|
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
|
|
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
|
-DCMAKE_PREFIX_PATH=${{ steps.strings.outputs.prefix-dir }}
|
|
-S ${{ github.workspace }}
|
|
|
|
- name: Build
|
|
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
|
|
|
|
- name: Test
|
|
working-directory: ${{ steps.strings.outputs.build-output-dir }}
|
|
run: ctest --build-config ${{ matrix.build_type }}
|