Continuous Integration v2 #1244
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
name: Continuous Integration v2 | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
CI: | |
name: ${{ matrix.name }} - ${{ matrix.configuration }} | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
configuration: [Debug, Release] | |
os: [windows-latest, windows-2019, ubuntu-latest, macos-11] | |
vulkanVersion: [1.3.231.1] | |
include: | |
- os: ubuntu-latest | |
container: novelrt/novelrt-build:latest | |
name: Ubuntu - Clang 10 | |
c: CC=clang-10 | |
cxx: CXX=clang++-10 | |
- os: windows-2019 | |
name: Windows - Visual Studio 2019 | |
- os: windows-latest | |
name: Windows - Visual Studio 2022 | |
- os: macos-11 | |
name: macOS 11 - Apple-Clang 13 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Cache Vulkan SDK (macOS) | |
if: "contains(matrix.os, 'macos')" | |
id: cache-vulkan-macOS | |
uses: actions/cache@v3 | |
with: | |
path: $GITHUB_WORKSPACE/VulkanSDK | |
key: ${{ runner.os }}-vulkansdk-${{ matrix.vulkanVersion }}-${{ hashFiles('**/mvk_vulkan.h') }} | |
restore-keys: | | |
${{ runner.os }}-vulkansdk-${{ matrix.vulkanVersion}}- | |
- name: Install Vulkan SDK (macOS) | |
if: "contains(matrix.os, 'macos') && steps.cache-vulkan-macOS.outputs.cache-hit != 'true'" | |
id: install-vulkan-macOS | |
run: scripts/ci-apple-installVulkanSDK.sh ${{ matrix.vulkanVersion }} $GITHUB_WORKSPACE/VulkanSDK | |
- name: Install Vulkan SDK (Windows) | |
uses: humbletim/setup-vulkan-sdk@v1.2.0 | |
if: "contains(matrix.os, 'windows')" | |
with: | |
vulkan-query-version: ${{ matrix.vulkanVersion }} | |
vulkan-components: Vulkan-Headers, Vulkan-Loader | |
vulkan-use-cache: true | |
- name: Restore Vulkan SDK Env. Variable (macOS) | |
if: "contains(matrix.os, 'macos') && steps.cache-vulkan-macOS.outputs.cache-hit == 'true'" | |
run: echo "VULKAN_SDK=$GITHUB_WORKSPACE/VulkanSDK/${{ matrix.vulkanVersion }}/macOS" >> $GITHUB_ENV | |
- uses: novelrt/setup-cpp@v1 | |
- name: Build NovelRT - ${{ matrix.configuration }} | |
id: build | |
run: | | |
${{ matrix.c }} ${{ matrix.cxx }} ${{ matrix.vulkan }} cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} | |
cmake --build build --config ${{ matrix.configuration }} --target Engine Interop Samples Engine_Tests -j | |
- name: Test NovelRT - ${{ matrix.configuration }} | |
if: steps.build.outcome == 'success' | |
id: test | |
run: | | |
cd build/tests/NovelRT.Tests | |
ctest --output-junit test-results.xml -C ${{ matrix.configuration }} | |
- name: Upload NovelRT test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Results (${{ matrix.os }}) | |
path: ./**/test-results.xml | |
Publish: | |
name: "Publish Test Results" | |
needs: CI | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
if: always() | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: "artifacts/**/*.xml" | |
json_file: "tests-results.json" | |
json_suite_details: true | |
Documentation: | |
name: Doxygen - Ubuntu | |
runs-on: ubuntu-latest | |
container: | |
image: novelrt/novelrt-build:latest | |
if: "!contains(github.ref, 'main')" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Generate Documentation | |
run: | | |
cmake -S . -B build -DCMAKE_BUILD_TYPE="Release" -DDOXYGEN_OUTPUT_DIRECTORY=$GITHUB_WORKSPACE/docs -DNOVELRT_BUILD_DOCUMENTATION=ON | |
cmake --build build --config Release --target Doxygen | |
Formatting: | |
name: clang-format | |
runs-on: ubuntu-latest | |
if: "!contains(github.ref, 'main')" | |
steps: | |
- name: Checkout Code | |
id: checkout | |
uses: actions/checkout@v2 | |
- name: Check Formatting | |
id: formatting | |
uses: DoozyX/clang-format-lint-action@v0.13 | |
with: | |
source: 'src tests include samples' | |
extensions: 'h,cpp,c,hpp' | |
clangFormatVersion: 10 | |
inplace: True | |
style: file | |
- name: Confirm Results | |
id: results | |
run: scripts/ci-checkdiff.sh | |
- name: Upload Patch | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: clang-format-patch | |
path: artifacts/clang-format.patch |