Files
gsmartcontrol/.github/workflows/cmake.yml
T

160 lines
4.1 KiB
YAML

name: CMake
on: [push]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
linux-ubuntu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt-get install libpcre3-dev libgtkmm-3.0-dev gettext
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: >-
cmake $GITHUB_WORKSPACE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
windows-msys2:
runs-on: windows-latest
strategy:
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 },
{ msystem: MINGW32, arch: i686 }
]
steps:
- uses: actions/checkout@v2
with:
path: temp
fetch-depth: 0
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
mingw-w64-${{ matrix.arch }}-gtkmm3
mingw-w64-${{ matrix.arch }}-pkg-config
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-make
- name: Create Build Directory
shell: msys2 {0}
run: cmake -E make_directory ${{runner.workspace}}\build
- name: Configure CMake
working-directory: ${{runner.workspace}}
shell: msys2 {0}
run: >-
cmake -B build -S . -G "MSYS Makefiles" ..
-DCMAKE_MAKE_PROGRAM=mingw32-make
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
shell: msys2 {0}
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config $BUILD_TYPE
macos-homebrew:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: brew install pkg-config gtkmm3 pcre cmake
- name: Create Build Directory
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: >-
cmake $GITHUB_WORKSPACE
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
freebsd:
# Disable for now - it fails with not being able to find packages for gtk30, libsigc++20, c++11-lang, pkgconfig.
if: ${{ false }}
runs-on: macos-latest
name: FreeBSD
# env:
# variables to pass to VM
# MYTOKEN : ${{ secrets.MYTOKEN }}
steps:
- uses: actions/checkout@v2
- name: Build and test in FreeBSD
id: test
uses: vmactions/freebsd-vm@v0.1.2
with:
envs: 'BUILD_TYPE'
usesh: true
sync: rsync
mem: 2048
prepare: |
pkg install -y cmake atkmm cairo glibmm gtk30 gtkmm30 libsigc++20 pangomm c++11-lang pkgconfig
run: |
mkdir build && cd build
cmake ..
-DAPP_BUILD_EXAMPLES=ON
-DAPP_BUILD_TESTS=ON
-DAPP_COMPILER_ENABLE_WARNINGS=ON
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
cmake --build . --config $BUILD_TYPE
# - name: Pack
# working-directory: ${{runner.workspace}}/build
# shell: bash
# run: cmake --build . --config $BUILD_TYPE --target package
# - name: Test
# working-directory: ${{runner.workspace}}/build
# shell: bash
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C $BUILD_TYPE