Skip to content

Commit

Permalink
Add github actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Jun 11, 2022
1 parent e724f48 commit 824aa62
Show file tree
Hide file tree
Showing 10 changed files with 316 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/analyze_asan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ASAN

on: [push, pull_request]

jobs:
linux-gcc-asan:
name: Linux ASAN
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y ninja-build libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev mesa-common-dev
- name: CMake configure -- Debug
run: cmake -S. -GNinja -Bcmake-build-asan -DCMAKE_BUILD_TYPE=Debug -DTA_ENABLE_ASAN=ON -DTA_ENABLE_WERROR=ON

- name: CMake build -- Debug
run: cmake --build cmake-build-asan

- name: CTest -- Debug
run: |
cd cmake-build-asan
ctest -C Debug
33 changes: 33 additions & 0 deletions .github/workflows/analyze_clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Clang-Tidy

on: [push, pull_request]

jobs:
clang-tidy-14:
name: Clang-Tidy-14
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y ninja-build libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev mesa-common-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14 all
- name: CMake configure -- Release
run: |
cmake -S . -G "Unix Makefiles" -B build -DCMAKE_BUILD_TYPE=Release -DTA_ENABLE_WERROR=ON -DCMAKE_C_COMPILER="clang-14" -DCMAKE_CXX_COMPILER="clang++-14"
cmake --build build --target RaumAkustik_BinaryData
- name: Clang-Tidy -- Release
run: BUILD_DIR=build make tidy-check
31 changes: 31 additions & 0 deletions .github/workflows/analyze_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Coverage

on: [push, pull_request]

jobs:
coverage:
name: Coverage
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y ninja-build libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev mesa-common-dev lcov gcovr
- name: Run coverage build
run: make coverage
36 changes: 36 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Linux

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64

- name: Install dependencies
run: |
sudo apt install -y ninja-build libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev mesa-common-dev
- name: CMake configure -- Release
run: cmake -S . -G Ninja -B cmake-build-release -DCMAKE_BUILD_TYPE=Release

- name: CMake build -- Release
run: cmake --build cmake-build-release

- name: CTest -- Release
run: ctest --test-dir cmake-build-release -C Release
31 changes: 31 additions & 0 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: macOS

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: macos-12
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Install dependencies
run: |
brew update
brew install ninja conan
- name: CMake configure -- Release
run: cmake -S . -G Xcode -B cmake-build-release -DCMAKE_BUILD_TYPE=Release

- name: CMake build -- Release
run: cmake --build cmake-build-release

- name: CTest -- Release
run: ctest --test-dir cmake-build-release -C Release
31 changes: 31 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Windows

on: [push, pull_request]

jobs:
build:
name: Build
runs-on: windows-2019
steps:
- name: Check out code
uses: actions/checkout@v2
with:
submodules: recursive
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64

- name: CMake configure -- Release
run: cmake -S . -B cmake-build-release -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Release

- name: CMake build -- Release
run: cmake --build cmake-build-release --config "Release"

- name: CTest -- Release
run: ctest --test-dir cmake-build-release -C Release
26 changes: 22 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
endif ()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(CompilerOptions)
include(CompilerWarnings)
include(CodeCoverage)

add_subdirectory(3rd_party/JUCE)
set_directory_properties(PROPERTIES JUCE_COMPANY_COPYRIGHT "SPDX: GPL-3.0-only")
set_directory_properties(PROPERTIES JUCE_COMPANY_NAME "tobantAudio")
set_directory_properties(PROPERTIES JUCE_COMPANY_WEBSITE "https://github.com/tobanteAudio/StiggiDJ")
set_directory_properties(PROPERTIES JUCE_COMPANY_EMAIL "[email protected]")

juce_add_gui_app(StiggiDJ
COMPANY_NAME "tobanteAudio" # Specify the name of the app's author
PRODUCT_NAME "Stiggi DJ" # The name of the final executable, which can differ from the target name
PRODUCT_NAME "Stiggi DJ"
BUNDLE_ID "com.tobanteAudio.stiggi-dj"
VERSION ${CMAKE_PROJECT_VERSION}
HARDENED_RUNTIME_ENABLED TRUE
)

target_sources(StiggiDJ
Expand Down Expand Up @@ -72,10 +83,14 @@ target_sources(StiggiDJ

target_compile_definitions(StiggiDJ
PRIVATE
JUCE_WEB_BROWSER=0 # If you remove this, add `NEEDS_WEB_BROWSER TRUE` to the `juce_add_gui_app` call
JUCE_USE_CURL=0 # If you remove this, add `NEEDS_CURL TRUE` to the `juce_add_gui_app` call
JUCE_APPLICATION_NAME_STRING="$<TARGET_PROPERTY:StiggiDJ,JUCE_PRODUCT_NAME>"
JUCE_APPLICATION_VERSION_STRING="$<TARGET_PROPERTY:StiggiDJ,JUCE_VERSION>"
JUCE_DISPLAY_SPLASH_SCREEN=0
JUCE_MODAL_LOOPS_PERMITTED=1
JUCE_REPORT_APP_USAGE=0
DONT_SET_USING_JUCE_NAMESPACE=1
JUCE_USE_CURL=0
JUCE_WEB_BROWSER=0
)

target_include_directories(StiggiDJ
Expand All @@ -94,4 +109,7 @@ target_link_libraries(StiggiDJ
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
ta::compiler_options
ta::compiler_warnings
ta::coverage
)
9 changes: 9 additions & 0 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Code Coverage Configuration
add_library(ta_coverage INTERFACE)
add_library(ta::coverage ALIAS ta_coverage)

if(TA_ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(ta_coverage INTERFACE -O0 -g --coverage)
target_link_libraries(ta_coverage INTERFACE --coverage)
target_link_options(ta_coverage INTERFACE --coverage)
endif()
28 changes: 28 additions & 0 deletions cmake/CompilerOptions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
add_library(ta_compiler_options INTERFACE)
add_library(ta::compiler_options ALIAS ta_compiler_options)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(ta_compiler_options INTERFACE "/permissive-")
endif()

if(TA_ENABLE_ASAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(ta_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ta_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
endif()

if(TA_ENABLE_UBSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(ta_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ta_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
endif()

if(TA_ENABLE_MSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(ta_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ta_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
endif()

if(TA_ENABLE_TSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(ta_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ta_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
endif()


56 changes: 56 additions & 0 deletions cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
add_library(ta_compiler_warnings INTERFACE)
add_library(ta::compiler_warnings ALIAS ta_compiler_warnings)

if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(ta_compiler_warnings INTERFACE /W3)
if (TA_ENABLE_WERROR)
target_compile_options(ta_compiler_warnings INTERFACE /WX)
endif (TA_ENABLE_WERROR)
else ()
target_compile_options(ta_compiler_warnings
INTERFACE
-Wall
-Wcast-align
-Wextra
-Wnarrowing
-Woverloaded-virtual
-Wpedantic
-Wreorder
-Wshadow
-Wsign-compare
-Wno-sign-conversion
-Wstrict-aliasing
-Wswitch-enum
-Wuninitialized
-Wunreachable-code
-Wunused-parameter
-Wzero-as-null-pointer-constant
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
-Wbool-conversion
-Wconditional-uninitialized
-Wconstant-conversion
# -Wconversion
-Wextra-semi
-Winconsistent-missing-destructor-override
-Wint-conversion
-Wnullable-to-nonnull-conversion
-Wshadow-all
-Wshift-sign-overflow
-Wshorten-64-to-32
-Wunused-private-field
>
$<$<CXX_COMPILER_ID:AppleClang>:
-Wno-poison-system-directories
>
$<$<CXX_COMPILER_ID:GNU>:
# -Wlogical-op
-Wno-maybe-uninitialized
-Wredundant-decls
-Wno-free-nonheap-object
$<$<VERSION_GREATER:CXX_COMPILER_VERSION,"11.0.0">:-Wno-free-nonheap-object>
>
)
if (TA_ENABLE_WERROR)
target_compile_options(ta_compiler_warnings INTERFACE -Werror)
endif (TA_ENABLE_WERROR)
endif ()

0 comments on commit 824aa62

Please sign in to comment.