-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from sudara/macos-fallbacks
Add tests in CI. Conditional support at compile and run time macOS versions
- Loading branch information
Showing
27 changed files
with
742 additions
and
445 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# https://forum.juce.com/t/automatic-juce-like-code-formatting-with-clang-format/31624/20 | ||
--- | ||
AccessModifierOffset: -4 | ||
AlignAfterOpenBracket: DontAlign | ||
AlignConsecutiveAssignments: None | ||
AlignConsecutiveDeclarations: None | ||
AlignEscapedNewlines: Left | ||
AlignOperands: Align | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakBeforeBinaryOperators: NonAssignment | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: # Allman except for lambdas | ||
AfterClass: true | ||
AfterCaseLabel: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
BeforeElse: true | ||
AfterControlStatement: Always | ||
BeforeLambdaBody: false | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakStringLiterals: false | ||
ColumnLimit: 0 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: false | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: true | ||
IndentPPDirectives: BeforeHash | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
Language: Cpp | ||
MaxEmptyLinesToKeep: 1 | ||
FixNamespaceComments: false | ||
NamespaceIndentation: All | ||
PointerAlignment: Left | ||
ReflowComments: true | ||
SortIncludes: true | ||
SpaceAfterCStyleCast: true | ||
SpaceAfterLogicalNot: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: true | ||
SpaceBeforeParens: NonEmptyParentheses | ||
SpaceInEmptyParentheses: false | ||
SpaceBeforeInheritanceColon: true | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: true | ||
SpacesInParentheses: false | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
SpacesInSquareBrackets: false | ||
Standard: "c++20" | ||
TabWidth: 4 | ||
UseTab: Never | ||
UseCRLF: false | ||
--- | ||
Language: ObjC | ||
BasedOnStyle: Chromium | ||
BreakBeforeBraces: Allman | ||
ColumnLimit: 0 | ||
IndentWidth: 4 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
PointerAlignment: Left | ||
SpacesBeforeTrailingComments: 1 | ||
TabWidth: 4 | ||
UseTab: Never | ||
LineEnding: LF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
BUILD_DIR: Builds | ||
CMAKE_BUILD_PARALLEL_LEVEL: 3 # Use up to 3 cpus to build juceaide, etc | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
SCCACHE_GHA_ENABLED: "true" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}.${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
BuildAndTest: | ||
name: Tests | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 10 | ||
|
||
strategy: | ||
fail-fast: false # show errors for each platform vs. cancel build | ||
matrix: | ||
os: [ macos-11, macos-12, macos-latest, windows-latest ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Install Ninja (Windows) | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: choco install ninja | ||
|
||
- name: Install macOS Deps | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: brew install ninja osxutils | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/sccache-action@v0.0.3 | ||
|
||
- name: Configure | ||
shell: bash | ||
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache . | ||
|
||
- name: Build | ||
shell: bash | ||
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel 4 | ||
|
||
- name: Test | ||
working-directory: ${{ env.BUILD_DIR }} | ||
run: ctest --output-on-failure -j4 -VV |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.DS_Store | ||
JuceLibraryCode | ||
Builds | ||
Testing/ | ||
.idea/ | ||
cmake-build-release | ||
cmake-build-relwithdebinfo | ||
cmake-build-debug | ||
CMakeCache.txt | ||
CMakeFiles/ | ||
xcode | ||
.vs | ||
out |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
|
||
project(MelatoninBlur VERSION 1.0.0 LANGUAGES CXX | ||
DESCRIPTION "Fast Blurs for JUCE" | ||
HOMEPAGE_URL "https://github.com/sudara/melatonin_blur") | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED YES) | ||
|
||
include(FetchContent) | ||
if (MelatoninBlur_IS_TOP_LEVEL) | ||
message(STATUS "Cloning JUCE...") | ||
|
||
FetchContent_Declare(JUCE | ||
GIT_REPOSITORY https://github.com/juce-framework/JUCE.git | ||
GIT_TAG origin/master | ||
GIT_SHALLOW TRUE | ||
GIT_PROGRESS TRUE) | ||
FetchContent_MakeAvailable(JUCE) | ||
|
||
FetchContent_Declare(Catch2 | ||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git | ||
GIT_PROGRESS TRUE | ||
GIT_SHALLOW TRUE | ||
GIT_TAG v3.4.0) | ||
FetchContent_MakeAvailable(Catch2) # find_package equivalent | ||
|
||
enable_testing() | ||
add_executable(Tests ${TestFiles}) | ||
target_compile_features(Tests PUBLIC cxx_std_17) | ||
|
||
target_sources(Tests PRIVATE "tests/blur_implementations.cpp" "tests/drop_shadow.cpp" "tests/inner_shadow.cpp") | ||
|
||
# Our test executable also wants to know about our plugin code... | ||
target_include_directories(Tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/source) | ||
|
||
juce_add_module("${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
target_link_libraries(Tests PRIVATE | ||
melatonin_blur | ||
Catch2::Catch2WithMain | ||
juce::juce_graphics # Image, etc | ||
juce::juce_gui_basics # Colour, etc | ||
juce::juce_audio_basics # FloatVectorOperations | ||
juce::juce_recommended_config_flags | ||
juce::juce_recommended_lto_flags | ||
juce::juce_recommended_warning_flags) | ||
|
||
# Enable this once tests are happy fundamentally in CI | ||
# set_target_properties("${TARGET_NAME}" PROPERTIES COMPILE_WARNING_AS_ERROR ON) | ||
|
||
include(${Catch2_SOURCE_DIR}/extras/Catch.cmake) | ||
catch_discover_tests(Tests) | ||
else () | ||
message(WARNING "This CMake config is just for CI tests.\nSubmit an Issue / PR if you want more CMake support: https://github.com/sudara/melatonin_blur ") | ||
endif () |
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
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
Oops, something went wrong.