Skip to content

Commit

Permalink
Add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJimmi committed Oct 19, 2023
1 parent 7b119ed commit 82efb0a
Show file tree
Hide file tree
Showing 47 changed files with 2,053 additions and 66 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/demo-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Demo Runner

on:
pull_request:
branches: [main]
push:
tags:
- v**

env:
BUILD_TYPE: Release

jobs:
build:
strategy:
matrix:
runner: [macos-latest, windows-latest]
include:
- generator: Xcode
runner: macos-latest
name: macOS
- generator: Visual Studio 17
runner: windows-latest
name: Windows

name: Build Demo ${{matrix.name}}
runs-on: ${{matrix.runner}}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: CMake Configure
run: cmake -Bbuild -G "${{matrix.generator}}" -DJIVE_BUILD_DEMO_RUNNER=ON

- name: CMake Build
run: cmake --build build --config "${{env.BUILD_TYPE}}"

- name: Stage artifacts
run: |
mkdir ./artifacts
if [[ $(uname) == "Darwin" ]]; then
for app in "$(find ./build/runners/demo-runner -name '*.app')"; do
mv "${app}" ./artifacts;
done
mv ./build/version.txt ./artifacts
elif [[ $(uname) == *"MINGW"* ]]; then
for exe in "$(find -wholename './build/runners/demo-runner/*.exe')"; do
cp -r "${exe}" ./artifacts;
done
fi
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./artifacts

release:
if: contains(github.ref, 'tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: .

- name: Set VERSION variable
run: |
VERSION_TXT=$(cat ./artifacts/version.txt)
echo "VERSION=$VERSION_TXT" >> $GITHUB_ENV
rm ./artifacts/version.txt
- name: Make zip
run: |
name="JIVE ${{env.VERSION}}"
mv ./artifacts/ "./$name/"
zip -r "$(name).zip" "./$name/"
- name: Release
uses: softprops/action-gh-release@v1
with:
name: "JIVE ${{env.VERSION}}"
files: ./*.zip
104 changes: 52 additions & 52 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
name: Test Runner

on:
pull_request:
branches: [ main ]
pull_request:
branches: [main]

env:
BUILD_TYPE: Debug
BUILD_TYPE: Debug

jobs:
test-windows:
name: Test Windows
runs-on: windows-latest
test-windows:
name: Test Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJIVE_BUILD_TEST_RUNNER=ON
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJIVE_BUILD_TEST_RUNNER=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ${{github.workspace}}/build/runners/test-runner/jive-test-runner_artefacts/${{env.BUILD_TYPE}}/jive-test-runner
- name: Test
working-directory: ${{github.workspace}}/build
run: ${{github.workspace}}/build/runners/test-runner/jive-test-runner_artefacts/${{env.BUILD_TYPE}}/jive-test-runner

test-macos:
name: Test macOS
runs-on: macos-latest
test-macos:
name: Test macOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Xcode -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJIVE_BUILD_TEST_RUNNER=ON -DJIVE_ENABLE_COVERAGE=ON
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Xcode -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DJIVE_BUILD_TEST_RUNNER=ON -DJIVE_ENABLE_COVERAGE=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ${{github.workspace}}/build/runners/test-runner/jive-test-runner_artefacts/${{env.BUILD_TYPE}}/jive-test-runner
- name: Test
working-directory: ${{github.workspace}}/build
run: ${{github.workspace}}/build/runners/test-runner/jive-test-runner_artefacts/${{env.BUILD_TYPE}}/jive-test-runner

- name: Install lcov
working-directory: ${{github.workspace}}/build
run: brew install lcov
- name: Install lcov
working-directory: ${{github.workspace}}/build
run: brew install lcov

- name: Generate Coverage Report
working-directory: ${{github.workspace}}/build
run: lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent --ignore-errors gcov
- name: Generate Coverage Report
working-directory: ${{github.workspace}}/build
run: lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent --ignore-errors gcov

- name: Upload Coverage
working-directory: ${{github.workspace}}/build
run: |
curl -Os https://uploader.codecov.io/latest/macos/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
- name: Upload Coverage
working-directory: ${{github.workspace}}/build
run: |
curl -Os https://uploader.codecov.io/latest/macos/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
verify-formatting:
name: Verify Formatting
runs-on: macos-latest
verify-formatting:
name: Verify Formatting
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
steps:
- uses: actions/checkout@v3

- name: Install clang-format
run: brew install clang-format
- name: Install clang-format
run: brew install clang-format

- name: Verify formatting
run: python3 ${{github.workspace}}/.github/scripts/verify_formatting.py
- name: Verify formatting
run: python3 ${{github.workspace}}/.github/scripts/verify_formatting.py
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
cmake_minimum_required(VERSION 3.15)
project(JIVE
VERSION 1.0.0
)
configure_file(${CMAKE_SOURCE_DIR}/version.txt.in version.txt)

option(JIVE_BUILD_TEST_RUNNER "Whether or not to build JIVE's test runner" OFF)
option(JIVE_BUILD_TEST_RUNNER "Build JIVE's test runner?" OFF)
option(JIVE_BUILD_DEMO_RUNNER "Build JIVE's demo runner?" OFF)

if (JIVE_BUILD_TEST_RUNNER)
project(JIVE)
if (JIVE_BUILD_TEST_RUNNER OR JIVE_BUILD_DEMO_RUNNER)
add_subdirectory(runners/libraries)
endif()

Expand Down
2 changes: 0 additions & 2 deletions jive_components/jive_components.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/* BEGIN_JUCE_MODULE_DECLARATION
ID: jive_components
vendor: ImJimmi
version: 0.1.0
name: JIVE Core
license: MIT
minimumCppStandard: 14
dependencies: jive_core
END_JUCE_MODULE_DECLARATION */

Expand Down
2 changes: 0 additions & 2 deletions jive_core/jive_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/* BEGIN_JUCE_MODULE_DECLARATION
ID: jive_core
vendor: ImJimmi
version: 0.1.0
name: JIVE Core
license: MIT
minimumCppStandard: 17
dependencies: juce_gui_basics
END_JUCE_MODULE_DECLARATION */

Expand Down
2 changes: 0 additions & 2 deletions jive_layouts/jive_layouts.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/* BEGIN_JUCE_MODULE_DECLARATION
ID: jive_layouts
vendor: ImJimmi
version: 0.1.0
name: JIVE Layouts
license: MIT
minimumCppStandard: 17
dependencies: jive_components
END_JUCE_MODULE_DECLARATION */

Expand Down
2 changes: 0 additions & 2 deletions jive_style_sheets/jive_style_sheets.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/* BEGIN_JUCE_MODULE_DECLARATION
ID: jive_style_sheets
vendor: ImJimmi
version: 0.1.0
name: JIVE Style Sheets
license: MIT
minimumCppStandard: 17
dependencies: jive_components
END_JUCE_MODULE_DECLARATION */

Expand Down
4 changes: 4 additions & 0 deletions runners/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if (JIVE_BUILD_TEST_RUNNER)
add_subdirectory(test-runner)
endif()

if (JIVE_BUILD_DEMO_RUNNER)
add_subdirectory(demo-runner)
endif()
77 changes: 77 additions & 0 deletions runners/demo-runner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
juce_add_gui_app(jive-demo-runner
PRODUCT_NAME "JIVE Demo Runner"
)

target_sources(jive-demo-runner
PRIVATE
source/main.cpp
)

juce_add_binary_data(jive-demo-runner-resources
HEADER_NAME "binary_data.h"
NAMESPACE "binary_data"

SOURCES
resources/icons/back-small.svg
resources/icons/build-large.svg
resources/icons/build-small.svg
resources/icons/code-large.svg
resources/icons/code-small.svg
resources/icons/layout-large.svg
resources/icons/layout-small.svg
resources/icons/next-small.svg
resources/icons/palette-large.svg
resources/icons/palette-small.svg
resources/rubik-mono-one.ttf
resources/rubik.ttf
resources/source-code-pro.ttf
)

target_compile_definitions(jive-demo-runner
PRIVATE
JIVE_DEMO_APPLICATION_NAME="$<TARGET_PROPERTY:jive-demo-runner,JUCE_PRODUCT_NAME>"
JIVE_DEMO_APPLICATION_VERSION="$<TARGET_PROPERTY:jive-demo-runner,JUCE_VERSION>"
JIVE_GUI_ITEMS_HAVE_STYLE_SHEETS=1
)

target_link_libraries(jive-demo-runner
PRIVATE
jive-demo-runner-resources
jive::jive_layouts
jive::jive_style_sheets
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
juce::juce_recommended_warning_flags
)

target_include_directories(jive-demo-runner
PRIVATE
source
)

target_compile_features(jive-demo-runner
PRIVATE
cxx_std_17
)

if (APPLE)
target_compile_options(jive-demo-runner
PRIVATE
-fsanitize=address
-fsanitize=undefined
-Werror
)

target_link_options(jive-demo-runner
PRIVATE
-fsanitize=address
-fsanitize=undefined
)
endif()

if (MSVC)
target_compile_options(jive-demo-runner
PRIVATE
/WX
)
endif()
9 changes: 9 additions & 0 deletions runners/demo-runner/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Third-party Resources

## Fonts

All fonts used in the demo are available from [Google Fonts](https://fonts.google.com) and licensed under the [Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL).

## Icons

All icons used in the demo are available from [Material Symbols and Icons - Google Fonts](https://fonts.google.com/icons) and licensed under the [Apache License Version 2.0](https://github.com/google/material-design-icons#license).
9 changes: 9 additions & 0 deletions runners/demo-runner/resources/icons/back-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions runners/demo-runner/resources/icons/build-large.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 82efb0a

Please sign in to comment.