-
Notifications
You must be signed in to change notification settings - Fork 5
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 #154 from ImJimmi/pluginval
Add pluginval to CTest for demo runner
- Loading branch information
Showing
4 changed files
with
129 additions
and
113 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 |
---|---|---|
@@ -1,121 +1,126 @@ | ||
name: Test Runner | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
run-name: "Test Runner - #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}" | ||
|
||
env: | ||
BUILD_TYPE: Debug | ||
CMAKE_BUILD_DIRECTORY: build | ||
BUILD_TYPE: Debug | ||
CMAKE_BUILD_DIRECTORY: build | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
run-tests: | ||
strategy: | ||
matrix: | ||
platform: [macos-latest, windows-latest] | ||
include: | ||
- platform: macos-latest | ||
platform-name: macOS | ||
package-manager: brew | ||
additional-cmake-options: -DJIVE_ENABLE_COVERAGE=ON | ||
- platform: windows-latest | ||
platform-name: Windows | ||
platform-shell: cmd | ||
package-manager: choco | ||
|
||
name: Test ${{ matrix.platform-name }} | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Install Ninja | ||
run: ${{ matrix.package-manager }} install ninja | ||
- name: Setup devcmd | ||
if: runner.os == 'Windows' | ||
uses: ilammy/[email protected] | ||
|
||
- name: CMake Generate | ||
run: | | ||
cmake \ | ||
-B ${{ env.CMAKE_BUILD_DIRECTORY }} \ | ||
-G Ninja \ | ||
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | ||
-D JIVE_BUILD_TEST_RUNNER=ON \ | ||
-D JIVE_BUILD_DEMO_RUNNER=ON \ | ||
${{ matrix.additional-cmake-options }} | ||
- name: CMake Build | ||
run: | | ||
cmake \ | ||
--build ${{ env.CMAKE_BUILD_DIRECTORY }} \ | ||
--config ${{ env.BUILD_TYPE }} | ||
- name: Run CTest | ||
run: | | ||
cd ${{ env.CMAKE_BUILD_DIRECTORY }} | ||
ctest \ | ||
--output-on-failure \ | ||
--extra-verbose \ | ||
-j14 \ | ||
-C ${{ env.BUILD_TYPE }} \ | ||
-T test \ | ||
-O ctest.log | ||
- name: Install lcov | ||
if: runner.os == 'macOS' | ||
working-directory: ${{github.workspace}}/build | ||
run: brew install lcov | ||
|
||
- name: Generate Coverage Report | ||
if: runner.os == 'macOS' | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
lcov \ | ||
--directory . \ | ||
--capture \ | ||
--output-file coverage.info \ | ||
--ignore-errors inconsistent \ | ||
--ignore-errors gcov \ | ||
--ignore-errors range \ | ||
--ignore-errors source | ||
- name: Upload Coverage Report | ||
if: runner.os == 'macOS' | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./build/coverage.info | ||
flags: unittests | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
|
||
- name: Stage Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "${{ matrix.platform-name }} #${{ github.event.pull_request.number }}" | ||
path: ${{ env.CMAKE_BUILD_DIRECTORY }}/ctest.log | ||
if-no-files-found: ignore | ||
retention-days: 7 | ||
overwrite: true | ||
|
||
verify-formatting: | ||
name: Verify Formatting | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install clang-format | ||
run: brew install clang-format | ||
|
||
- name: Verify formatting | ||
run: python3 .github/scripts/verify_formatting.py | ||
run-tests: | ||
strategy: | ||
matrix: | ||
platform: [macos-latest, windows-latest] | ||
include: | ||
- platform: macos-latest | ||
platform-name: macOS | ||
package-manager: brew | ||
additional-cmake-options: -DJIVE_ENABLE_COVERAGE=ON -DJIVE_ENABLE_SANITISERS=ON | ||
|
||
- platform: windows-latest | ||
platform-name: Windows | ||
platform-shell: cmd | ||
package-manager: choco | ||
additional-cmake-options: -DCMAKE_PROGRAM_PATH="C:\ProgramData\chocolatey\lib\pluginval\tools" | ||
|
||
name: Test ${{ matrix.platform-name }} | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "recursive" | ||
|
||
- name: Install Ninja | ||
run: ${{ matrix.package-manager }} install ninja | ||
- name: Install pluginval | ||
run: ${{matrix.package-manager}} install pluginval | ||
|
||
- name: Setup devcmd | ||
if: runner.os == 'Windows' | ||
uses: ilammy/[email protected] | ||
|
||
- name: CMake Generate | ||
run: | | ||
cmake \ | ||
-B ${{ env.CMAKE_BUILD_DIRECTORY }} \ | ||
-G Ninja \ | ||
-D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | ||
-D JIVE_BUILD_TEST_RUNNER=ON \ | ||
-D JIVE_BUILD_DEMO_RUNNER=ON \ | ||
${{ matrix.additional-cmake-options }} | ||
- name: CMake Build | ||
run: | | ||
cmake \ | ||
--build ${{ env.CMAKE_BUILD_DIRECTORY }} \ | ||
--config ${{ env.BUILD_TYPE }} | ||
- name: Run CTest | ||
run: | | ||
cd ${{ env.CMAKE_BUILD_DIRECTORY }} | ||
ctest \ | ||
--output-on-failure \ | ||
--extra-verbose \ | ||
-j14 \ | ||
-C ${{ env.BUILD_TYPE }} \ | ||
-T test \ | ||
-O ctest.log | ||
- name: Install lcov | ||
if: runner.os == 'macOS' | ||
working-directory: ${{github.workspace}}/build | ||
run: brew install lcov | ||
|
||
- name: Generate Coverage Report | ||
if: runner.os == 'macOS' | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
lcov \ | ||
--directory . \ | ||
--capture \ | ||
--output-file coverage.info \ | ||
--ignore-errors inconsistent \ | ||
--ignore-errors gcov \ | ||
--ignore-errors range \ | ||
--ignore-errors source | ||
- name: Upload Coverage Report | ||
if: runner.os == 'macOS' | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./build/coverage.info | ||
flags: unittests | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true | ||
|
||
- name: Stage Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "${{ matrix.platform-name }} #${{ github.event.pull_request.number }}" | ||
path: ${{ env.CMAKE_BUILD_DIRECTORY }}/ctest.log | ||
if-no-files-found: ignore | ||
retention-days: 7 | ||
overwrite: true | ||
|
||
verify-formatting: | ||
name: Verify Formatting | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install clang-format | ||
run: brew install clang-format | ||
|
||
- name: Verify formatting | ||
run: python3 .github/scripts/verify_formatting.py |
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
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,10 @@ | ||
function (add_pluginval_tests | ||
TARGET | ||
) | ||
file(DOWNLOAD | ||
https://raw.githubusercontent.com/Tracktion/pluginval/refs/heads/develop/tests/AddPluginvalTests.cmake | ||
${CMAKE_BINARY_DIR}/pluginval/AddPluginvalTests.cmake | ||
) | ||
include(${CMAKE_BINARY_DIR}/pluginval/AddPluginvalTests.cmake) | ||
add_pluginval_tests(${TARGET}) | ||
endfunction () |