-
Notifications
You must be signed in to change notification settings - Fork 43
156 lines (134 loc) · 4.87 KB
/
build-system.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
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-13, macos-14]
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-13
name: macOS 13 (x64) - Apple-Clang 15
- os: macos-14
name: macOS 14 (arm64) - Apple-Clang 15
args: -DCMAKE_APPLE_SILICON_PROCESSOR="arm64"
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Vulkan SDK (macOS)
if: "contains(matrix.os, 'macos')"
id: cache-vulkan-macOS
uses: actions/cache@v4
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/[email protected]
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 }} ${{ matrix.args }}
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@v4
with:
name: Test Results (${{ matrix.os }}-${{ matrix.configuration }})
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@v4
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@v4
- 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@v4
- name: Check Formatting
id: formatting
uses: DoozyX/[email protected]
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@v4
if: ${{ failure() }}
with:
name: clang-format-patch
path: artifacts/clang-format.patch