Start running builds and tests on the CI #30
Workflow file for this run
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: 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 | |
- os: ubuntu-latest | |
c_compiler: cl | |
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" | |
- name: Setup Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install \ | |
gettext \ | |
- name: Setup Windows dependencies | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
$ProgressPreference = 'SilentlyContinue' | |
echo $Env:USERPROFILE\bin >> $Env:GITHUB_PATH | |
Invoke-WebRequest https://github.com/restic/test-assets/raw/master/libintl-0.11.5-2-bin.zip -OutFile libintl.zip | |
unzip libintl.zip | |
- name: Build zlib | |
if: runner.os == 'Windows' | |
run: | | |
git clone https://github.com/madler/zlib.git | |
cmake -B ${{ steps.strings.outputs.build-output-dir }}-zlib -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 zlib "H"-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.prefix-dir }} -DBUILD_TESTING=OFF | |
cmake --build ${{ steps.strings.outputs.build-output-dir }}-zlib --target install | |
- name: Build 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 --target install | |
- name: Build 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 --target install | |
- name: Build 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 --target install | |
- name: Build 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 -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DWITH_LIBZSTD=OFF # TODO: enable bzip which we need later | |
cmake --build ${{ steps.strings.outputs.build-output-dir }}-karchive --target install | |
- name: Build 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 --target install | |
- 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 }} |