Skip to content

Commit 33367cc

Browse files
JeanPhilippeKernelMathewBenson
authored andcommitted
Code Restructure To Enable Linux & MacOS Builds
Closes #354 Closes #355 - Move from github-submodule structure to use CMake's native dependency management facilities. (https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html). Ideally the dependencies are to be installed using native mechanisms like vcpkg on windows, the linux distribution package manager or homebrew for mac. CMake will find the installed versions as a first option but build the dependencies if not available in the Build Directory at Build time. The linux_build code action is an example of this working in linux. - Changed CI workflow to remove separate test job and instead do the testing within the same instance that does the build - Also removed the clang-format CI step as a dependency of the other build systems. This was to first ensure successful building and testing on the various platforms. should likely be incorporated into the individual system build steps
1 parent e34f808 commit 33367cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+495
-583
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ PenaltyBreakTemplateDeclaration: 100
120120
PenaltyReturnTypeOnItsOwnLine: 300
121121
PointerAlignment: Left
122122
ReflowComments: true
123-
SortIncludes: true
123+
SortIncludes: false
124124
SortUsingDeclarations: true
125125
SpaceAfterCStyleCast: true
126126
SpaceAfterLogicalNot: false

.github/workflows/Engine-CI.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,15 @@ on:
55
branches: [ master, develop, arena-integration ]
66

77
jobs:
8-
clang-format:
9-
strategy:
10-
matrix:
11-
directories: [ZEngine, Tetragrama]
12-
uses: ./.github/workflows/job-clangformat.yml
13-
with:
14-
srcDirectory: ${{ matrix.directories }}
15-
168
windows:
17-
needs: clang-format
189
uses: ./.github/workflows/windows-build.yml
1910
with:
2011
targetFramework: net8.0
2112

2213
macOS:
23-
needs: clang-format
2414
uses: ./.github/workflows/macOS-build.yml
2515
with:
2616
targetFramework: net8.0
17+
18+
linux:
19+
uses: ./.github/workflows/linux-build.yml

.github/workflows/job-clangformat.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: ZEngine Code Formatting
22

33
on:
44
workflow_call:
5-
inputs:
6-
srcDirectory:
7-
type: string
85

96
jobs:
107
format:
@@ -15,5 +12,5 @@ jobs:
1512
uses: actions/checkout@v4
1613

1714
- name: Checking formatting
18-
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }}/${{ inputs.srcDirectory }} -RunAsCheck 1
15+
run: .\Scripts\ClangFormat.ps1 -SourceDirectory ${{ github.workspace }} -RunAsCheck 1
1916
shell: pwsh
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ZEngine Cmake Linux Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
configuration:
7+
type: string
8+
default: 'Debug'
9+
10+
jobs:
11+
Linux-Build:
12+
name: cmake-build-linux-${{ inputs.configuration }}
13+
runs-on: ubuntu-24.04
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Powershell Repository
20+
run: curl -O https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb && sudo dpkg -i packages-microsoft-prod.deb
21+
22+
- name: Install External Dependencies
23+
run: sudo apt-get update && sudo apt-get install -y git libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev cmake gcc g++ ninja-build libassimp-dev libfmt-dev libimgui-dev libstb-dev libglfw3-dev libspdlog-dev libglm-dev libyaml-cpp-dev libspirv-cross-c-shared-dev spirv-cross spirv-tools glslang-dev glslang-tools nlohmann-json3-dev dotnet-runtime-8.0 libgtest-dev powershell
24+
25+
- name: CMake Build
26+
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
27+
shell: pwsh
28+
29+
- name: Run Tests
30+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
31+
shell: pwsh

.github/workflows/job-cmakebuild-macOS.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26+
- name: Install Dependencies
27+
run: brew install vulkan-headers vulkan-loader vulkan-tools assimp spirv-headers spirv-tools spirv-cross glslang glfw glew yaml-cpp spdlog googletest
28+
2629
- name: CMake Build
2730
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
2831
shell: pwsh
2932

30-
- name: Publish Build Artifacts
31-
uses: actions/upload-artifact@v4
32-
with:
33-
name: Build-macOS-${{ inputs.architecture }}-${{inputs.configuration}}
34-
path: |
35-
Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/osx-${{ inputs.architecture }}/publish/
36-
Result.Darwin.x64.${{inputs.configuration}}/__externals/Vulkan-Loader/loader/${{ inputs.configuration }}/
37-
Result.Darwin.x64.${{inputs.configuration}}/ZEngine/tests/${{inputs.configuration}}/
38-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
39-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
40-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
41-
!Result.Darwin.x64.${{inputs.configuration}}/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
33+
- name: Update access permission of ZEngineTests
34+
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/ZEngineTests
35+
36+
- name: Run Tests
37+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
38+
shell: pwsh

.github/workflows/job-cmakebuild-windows.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,19 @@ jobs:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222

23+
- name: Install Vcpkg
24+
run: git clone --depth=1 https://github.com/Microsoft/vcpkg; bootstrap-vcpkg.bat
25+
shell: pwsh
26+
27+
- name: Install Vulkan
28+
run: vcpkg install vulkan
29+
shell: pwsh
30+
2331
- name: CMake Build
24-
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
32+
run: $env:CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake"; .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}} -RunClangFormat 0
2533
shell: pwsh
2634

27-
- name: Publish Build Artifacts
28-
uses: actions/upload-artifact@v4
29-
with:
30-
name: Build-Windows-x64-${{inputs.configuration}}
31-
path: |
32-
Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/win-x64/publish/
33-
Result.Windows.x64.MultiConfig/ZEngine/tests/${{inputs.configuration}}/
34-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
35-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
36-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
37-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
38-
!Result.Windows.x64.MultiConfig/Panzerfaust/${{inputs.configuration}}/${{inputs.targetFramework}}/**/createdump.exe
35+
- name: Run Tests
36+
shell: pwsh
37+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
3938

40-
- name: Publish Vulkan Build Artifacts
41-
if: ${{ inputs.configuration == 'Release'}}
42-
uses: actions/upload-artifact@v4
43-
with:
44-
name: Vulkan-build-x64-release
45-
path: |
46-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.dll
47-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.exp
48-
Result.Windows.x64.MultiConfig/__externals/Vulkan-Loader/loader/release/vulkan-1.lib

.github/workflows/job-test-macOS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
path: Result.Darwin.x64.${{ inputs.configuration }}
2828

2929
- name: Update access permission of ZEngineTests
30-
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/${{ inputs.configuration }}/ZEngineTests
30+
run: chmod +x ./Result.Darwin.x64.${{ inputs.configuration }}/ZEngine/tests/ZEngineTests
3131

3232
- name: Run Tests
3333
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

.github/workflows/job-test-windows.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,3 @@ jobs:
2323
path: Result.Windows.x64.MultiConfig
2424
name: Build-Windows-x64-${{ inputs.configuration }}
2525

26-
- name: Download Vulkan Artifacts
27-
uses: actions/download-artifact@v4
28-
with:
29-
path: vulkan-build
30-
name: Vulkan-build-x64-release
31-
32-
- name: Run Tests
33-
shell: pwsh
34-
run: |
35-
$env:PATH = ".\vulkan-build\;$env:PATH"
36-
.\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}

.github/workflows/linux-build.yml

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,14 @@
1-
# @JeanPhilippeKernel : Disabled because we only support Windows as platform for now
2-
#
31
name: ZEngine Linux Build
42

53
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
4+
workflow_call:
105

116
jobs:
12-
Linux-Build:
13-
runs-on: ubuntu-latest
7+
cmake-build:
148
strategy:
159
matrix:
16-
buildConfiguration: [Debug, Release]
10+
buildConfiguration: [Debug, Release]
11+
uses: ./.github/workflows/job-cmakebuild-linux.yml
12+
with:
13+
configuration: ${{matrix.buildConfiguration}}
1714

18-
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v2
21-
22-
# - name: Checkout submodules
23-
# run: git submodule update --init --recursive
24-
25-
# - name: Install development library
26-
# run: sudo apt-get install libasound2-dev libgl1-mesa-dev libpulse-dev libdbus-1-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev libxss-dev libxt-dev libxxf86vm-dev
27-
28-
# - name: Install CMake
29-
# uses: jwlawson/actions-setup-cmake@v1.9
30-
# with:
31-
# cmake-version: '3.20.x'
32-
33-
# - name: Install pre-requisite packages.
34-
# run: sudo apt-get install -y wget apt-transport-https software-properties-common
35-
36-
# - name: Download the Microsoft repository GPG keys
37-
# run: wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
38-
39-
# - name: Register the Microsoft repository GPG keys
40-
# run: sudo dpkg -i packages-microsoft-prod.deb
41-
42-
# - name: Update the list of packages after we added packages.microsoft.com
43-
# run: sudo apt-get update
44-
45-
# - name: Install PowerShell
46-
# run: sudo apt-get install -y powershell
47-
48-
# - name: Add GCC Toolchain repository
49-
# run: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
50-
51-
# - name: Install GCC compiler
52-
# run: sudo apt install -y gcc-11
53-
54-
# - name: Install G++ compiler
55-
# run: sudo apt install -y g++-11
56-
57-
# - name: CMake Build
58-
# run: .\Scripts\BuildEngine.ps1 -Configurations ${{matrix.buildConfiguration}}
59-
# shell: pwsh

.github/workflows/macOS-build.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,3 @@ jobs:
1919
architecture: ${{ matrix.architecture }}
2020
targetFramework: ${{inputs.targetFramework}}
2121

22-
test:
23-
needs: cmake-build
24-
strategy:
25-
matrix:
26-
testConfiguration: [Debug, Release]
27-
architecture: [x64, arm64]
28-
uses: ./.github/workflows/job-test-macOS.yml
29-
with:
30-
configuration: ${{matrix.testConfiguration}}
31-
architecture: ${{ matrix.architecture }}
32-
33-
deploy:
34-
needs: test
35-
strategy:
36-
matrix:
37-
architecture: [x64, arm64]
38-
uses: ./.github/workflows/job-deploy-macOS.yml
39-
with:
40-
configuration: Release
41-
architecture: ${{ matrix.architecture }}
42-
targetFramework: ${{inputs.targetFramework}}

0 commit comments

Comments
 (0)