2022-05-25 20:36:50 -05:00
name : build
on :
push :
branches : [ master ]
pull_request :
branches : [ master ]
jobs :
clang-format :
name : ClangFormat check
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Format code
2024-05-31 19:29:33 -05:00
# ClangFormat 14 has a bug, which seems to be fixed in ClangFormat 15. Until GitHub-hosted runners support ClangFormat 15, we will stay at ClangFormat 13.
run : find src/ test/ -iname '*.c' -or -iname '*.cpp' -or -iname '*.m' -or -iname '*.mm' -or -iname '*.h' -or -iname '*.hpp' | xargs clang-format-13 -i -style=file
2022-05-25 20:36:50 -05:00
- name : Check diff
run : git diff --exit-code
build-ubuntu :
2024-05-31 19:29:33 -05:00
name : Ubuntu ${{ matrix.os.name }} - ${{ matrix.compiler.name }}, ${{ matrix.portal.name }}, ${{ matrix.autoappend.name }}, ${{ matrix.shared_lib.name }}, C++${{ matrix.cppstd }}
runs-on : ${{ matrix.os.label }}
2022-05-25 20:36:50 -05:00
strategy :
matrix :
2024-05-31 19:29:33 -05:00
os : [ {label: ubuntu-latest, name : latest}, {label: ubuntu-20.04, name: 20.04} ]
2022-05-25 20:36:50 -05:00
portal : [ {flag: OFF, dep: libgtk-3-dev, name : GTK}, {flag: ON, dep: libdbus-1-dev, name: Portal} ] # The NFD_PORTAL setting defaults to OFF (i.e. uses GTK)
2024-05-31 19:29:33 -05:00
autoappend : [ {flag: OFF, name : NoAppendExtn} ] # By default the NFD_PORTAL mode does not append extensions, because it breaks some features of the portal
compiler : [ {c: gcc, cpp: g++, name : GCC}, {c: clang, cpp: clang++, name: Clang} ] # The default compiler is gcc/g++
cppstd : [ 20 , 11 ]
shared_lib : [ {flag: OFF, name : Static} ]
include :
- os : {label: ubuntu-latest, name : latest}
portal : {flag: ON, dep: libdbus-1-dev, name : Portal}
autoappend : {flag: ON, name : AutoAppendExtn}
compiler : {c: gcc, cpp: g++, name : GCC}
cppstd : 11
shared_lib : {flag: OFF, name : Static}
- os : {label: ubuntu-latest, name : latest}
portal : {flag: ON, dep: libdbus-1-dev, name : Portal}
autoappend : {flag: ON, name : AutoAppendExtn}
compiler : {c: clang, cpp: clang++, name : Clang}
cppstd : 11
shared_lib : {flag: OFF, name : Static}
- os : {label: ubuntu-latest, name : latest}
portal : {flag: ON, dep: libdbus-1-dev, name : Portal}
autoappend : {flag: ON, name : NoAppendExtn}
compiler : {c: gcc, cpp: g++, name : GCC}
cppstd : 11
shared_lib : {flag: ON, name : Shared}
2022-05-25 20:36:50 -05:00
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Installing Dependencies
run : sudo apt-get update && sudo apt-get install ${{ matrix.portal.dep }}
- name : Configure
2024-05-31 19:29:33 -05:00
run : mkdir build && mkdir install && cd build && cmake -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} -DCMAKE_CXX_STANDARD=${{ matrix.cppstd }} -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic" -DNFD_PORTAL=${{ matrix.portal.flag }} -DNFD_APPEND_EXTENSION=${{ matrix.autoappend.flag }} -DBUILD_SHARED_LIBS=${{ matrix.shared_lib.flag }} -DNFD_BUILD_TESTS=ON ..
2022-05-25 20:36:50 -05:00
- name : Build
run : cmake --build build --target install
- name : Upload test binaries
uses : actions/upload-artifact@v2
with :
2024-05-31 19:29:33 -05:00
name : Ubuntu ${{ matrix.os.name }} - ${{ matrix.compiler.name }}, ${{ matrix.portal.name }}, ${{ matrix.autoappend.name }}, ${{ matrix.shared_lib.name }}, C++${{ matrix.cppstd }}
2022-05-25 20:36:50 -05:00
path : |
2024-05-31 19:29:33 -05:00
build/src/*
build/test/*
2022-05-25 20:36:50 -05:00
build-macos-clang :
2024-05-31 19:29:33 -05:00
name : MacOS ${{ matrix.os.name }} - Clang, ${{ matrix.shared_lib.name }}
runs-on : ${{ matrix.os.label }}
strategy :
matrix :
os : [ {label: macos-latest, name : latest}, {label: macos-11, name: 11} ]
shared_lib : [ {flag: OFF, name : Static} ]
include :
- os : {label: macos-latest, name : latest}
shared_lib : {flag: ON, name : Shared}
2022-05-25 20:36:50 -05:00
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Configure
2024-05-31 19:29:33 -05:00
run : mkdir build && mkdir install && cd build && cmake -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic" -DBUILD_SHARED_LIBS=${{ matrix.shared_lib.flag }} -DNFD_BUILD_TESTS=ON ..
2022-05-25 20:36:50 -05:00
- name : Build
run : cmake --build build --target install
- name : Upload test binaries
uses : actions/upload-artifact@v2
with :
2024-05-31 19:29:33 -05:00
name : MacOS ${{ matrix.os.name }} - Clang, ${{ matrix.shared_lib.name }}
2022-05-25 20:36:50 -05:00
path : |
2024-05-31 19:29:33 -05:00
build/src/*
build/test/*
2022-05-25 20:36:50 -05:00
build-windows-msvc :
2024-05-31 19:29:33 -05:00
name : Windows latest - MSVC, ${{ matrix.shared_lib.name }}
2022-05-25 20:36:50 -05:00
runs-on : windows-latest
2024-05-31 19:29:33 -05:00
strategy :
matrix :
shared_lib : [ {flag: OFF, name : Static}, {flag: ON, name: Shared} ]
2022-05-25 20:36:50 -05:00
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Configure
2024-05-31 19:29:33 -05:00
run : mkdir build && mkdir install && cd build && cmake -DCMAKE_INSTALL_PREFIX="../install" -DBUILD_SHARED_LIBS=${{ matrix.shared_lib.flag }} -DNFD_BUILD_TESTS=ON ..
2022-05-25 20:36:50 -05:00
- name : Build
run : cmake --build build --target install --config Release
- name : Upload test binaries
uses : actions/upload-artifact@v2
with :
2024-05-31 19:29:33 -05:00
name : Windows latest - MSVC, ${{ matrix.shared_lib.name }}
2022-05-25 20:36:50 -05:00
path : |
2024-05-31 19:29:33 -05:00
build/src/Release/*
build/test/Release/*
2022-05-25 20:36:50 -05:00
build-windows-clang :
2024-05-31 19:29:33 -05:00
name : Windows latest - Clang, Static
2022-05-25 20:36:50 -05:00
runs-on : windows-latest
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Configure
run : mkdir build && mkdir install && cd build && cmake -DCMAKE_INSTALL_PREFIX="../install" -T ClangCL -DNFD_BUILD_TESTS=ON ..
- name : Build
run : cmake --build build --target install --config Release
- name : Upload test binaries
uses : actions/upload-artifact@v2
with :
2024-05-31 19:29:33 -05:00
name : Windows latest - Clang, Static
2022-05-25 20:36:50 -05:00
path : |
2024-05-31 19:29:33 -05:00
build/src/Release/*
build/test/Release/*
2022-05-25 20:36:50 -05:00
build-windows-mingw :
2024-05-31 19:29:33 -05:00
name : Windows latest - MinGW, Static
2022-05-25 20:36:50 -05:00
runs-on : windows-latest
defaults :
run :
shell : msys2 {0}
steps :
- name : Checkout
uses : actions/checkout@v2
- name : Set up MinGW-w64
uses : msys2/setup-msys2@v2
with :
path-type : minimal
install : >-
base-devel
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
- name : Configure
2024-05-31 19:29:33 -05:00
run : mkdir build && mkdir install && cd build && cmake -DCMAKE_INSTALL_PREFIX="../install" -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -G 'MSYS Makefiles' -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-Wall -Wextra -Werror -pedantic" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -pedantic" -DNFD_BUILD_TESTS=ON ..
2022-05-25 20:36:50 -05:00
- name : Build
run : cmake --build build --target install
- name : Upload test binaries
uses : actions/upload-artifact@v2
with :
2024-05-31 19:29:33 -05:00
name : Windows latest - MinGW, Static
2022-05-25 20:36:50 -05:00
path : |
2024-05-31 19:29:33 -05:00
build/src/*
build/test/*