Skip to content

Commit 55711e3

Browse files
Add Linux CI workflow
1 parent 99bdf72 commit 55711e3

9 files changed

Lines changed: 147 additions & 67 deletions

File tree

.github/workflows/Engine-CI.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ jobs:
2424
uses: ./.github/workflows/macOS-build.yml
2525
with:
2626
targetFramework: net8.0
27+
28+
linux:
29+
needs: clang-format
30+
uses: ./.github/workflows/linux-build.yml
31+
with:
32+
targetFramework: net8.0
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: ZEngine Cmake Linux Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
configuration:
7+
type: string
8+
default: 'Debug'
9+
targetFramework:
10+
type: string
11+
default: 'net8.0'
12+
13+
jobs:
14+
Linux-Build:
15+
name: cmake-build-linux-${{ inputs.configuration }}
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Download the Microsoft repository GPG keys
23+
run: wget -q https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
24+
25+
- name: Register the Microsoft repository GPG keys
26+
run: sudo dpkg -i packages-microsoft-prod.deb
27+
28+
- name: Update the list of packages after we added packages.microsoft.com
29+
run: sudo apt-get update
30+
31+
- name: Install development library
32+
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 cmake apt-transport-https software-properties-common gcc g++ powershell clang-format
33+
34+
- name: CMake Build
35+
run: .\Scripts\BuildEngine.ps1 -Configurations ${{inputs.configuration}}
36+
shell: pwsh
37+
38+
- name: Publish Build Artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: Build-linux-${{inputs.configuration}}
42+
path: |
43+
Panzerfaust/bin/${{inputs.configuration}}/publish/
44+
Result.Linux.x64.${{inputs.configuration}}/__externals/Vulkan-Loader/loader/
45+
Result.Linux.x64.${{inputs.configuration}}/ZEngine/tests/
46+
Panzerfaust/bin/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.resources.dll
47+
!Panzerfaust/bin/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.CSharp.Scripting.resources.dll
48+
!Panzerfaust/bin/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.resources.dll
49+
!Panzerfaust/bin/${{inputs.configuration}}/${{inputs.targetFramework}}/**/Microsoft.CodeAnalysis.Scripting.resources.dll
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Deploy for linux
2+
#
3+
name: linux Deploy Workflow
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
targetFramework:
9+
type: string
10+
required: true
11+
configuration:
12+
type: string
13+
default: 'Release'
14+
15+
jobs:
16+
deploy:
17+
name: deploy-linux-${{ inputs.configuration }}
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/download-artifact@v4
21+
with:
22+
path: Result.Darwin.x64.${{ inputs.configuration }}
23+
name: Build-linux-Release
24+
25+
- name: Publish Artifacts
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: linux-${{ inputs.configuration }}
29+
path: Panzerfaust/bin/${{ inputs.configuration }}/${{inputs.targetFramework}}/publish/
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Run tests for linux
2+
#
3+
name: linux Test Workflow
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
configuration:
9+
type: string
10+
default: 'Debug'
11+
12+
jobs:
13+
test:
14+
name: test-linux-${{ inputs.configuration }}
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Download Artifacts
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: Build-linux-${{ inputs.configuration }}
24+
path: Result.Linux.x64.${{ inputs.configuration }}
25+
26+
- name: Run Tests
27+
run: .\Scripts\RunTests.ps1 -Configurations ${{ inputs.configuration }}
28+
shell: pwsh

.github/workflows/linux-build.yml

Lines changed: 28 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,37 @@
1-
# @JeanPhilippeKernel : Disabled because we only support Windows as platform for now
1+
# @JeanPhilippeKernel
22
#
33
name: ZEngine Linux Build
44

55
on:
6-
push:
7-
branches: [ master ]
8-
pull_request:
9-
branches: [ master ]
6+
workflow_call:
7+
inputs:
8+
targetFramework:
9+
required: true
10+
type: string
1011

1112
jobs:
12-
Linux-Build:
13-
runs-on: ubuntu-latest
13+
cmake-build:
1414
strategy:
1515
matrix:
16-
buildConfiguration: [Debug, Release]
17-
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
16+
buildConfiguration: [Debug, Release]
17+
uses: ./.github/workflows/job-cmakebuild-linux.yml
18+
with:
19+
configuration: ${{matrix.buildConfiguration}}
20+
targetframework: ${{inputs.targetFramework}}
21+
22+
test:
23+
needs: cmake-build
24+
strategy:
25+
matrix:
26+
testConfiguration: [Debug, Release]
27+
uses: ./.github/workflows/job-test-linux.yml
28+
with:
29+
configuration: ${{matrix.testConfiguration}}
30+
31+
deploy:
32+
needs: test
33+
uses: ./.github/workflows/job-deploy-linux.yml
34+
with:
35+
configuration: Release
36+
targetframework: ${{inputs.targetFramework}}
5637

57-
# - name: CMake Build
58-
# run: .\Scripts\BuildEngine.ps1 -Configurations ${{matrix.buildConfiguration}}
59-
# shell: pwsh

Scripts/BuildEngine.ps1

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,9 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
156156
}
157157
"Linux" {
158158
$cMakeGenerator = "-G Ninja"
159-
160-
# Set Linux build compiler
161-
$env:CC = 'gcc'
162-
$env:CXX = 'g++'
163159
}
164160
"Darwin" {
165-
$cMakeGenerator = "-G Ninja"
161+
$cMakeGenerator = "-G `"Xcode`""
166162
$cMakeCacheVariableOverride += ' ' + $submoduleCMakeOptions.FRAMEWORK -join ' '
167163
}
168164
Default {

Scripts/Shared.ps1

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ function Find-GlslangValidator () {
185185

186186
function Find-ClangFormat () {
187187
$repoConfiguration = Get-RepositoryConfiguration
188-
$LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version
189188

190189
$candidates = @(
191190
'clang-format'
@@ -200,17 +199,10 @@ function Find-ClangFormat () {
200199

201200
foreach ($candidate in $candidates) {
202201
$clangFormatCommand = Get-Command $candidate -ErrorAction SilentlyContinue
203-
if ($clangFormatCommand) {
204-
if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") {
205-
[Version] $clangFormatVersion = $Matches[1]
206-
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) ) {
207-
return $clangFormatCommand.Source
208-
}
209-
}
210202
}
211203
}
212204

213-
throw "Failed to find clang-format min $LLVMMinimumVersion. Tried: " + ($candidates -join ', ')
205+
throw "Failed to find clang-format. Tried: " + ($candidates -join ', ')
214206
}
215207

216208
function Setup-ShaderCCompilerTool () {

__externals/externals.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Packages
22
#
3-
set(ASSIMP_WARNINGS_AS_ERRORS=OFF)
43

5-
add_subdirectory (${EXTERNAL_DIR}/Vulkan-Headers)
4+
set (CMAKE_PREFIX_PATH
5+
${CMAKE_PREFIX_PATH}
6+
${EXTERNAL_DIR}/Vulkan-Headers/build/install/share/cmake
7+
)
68
add_subdirectory (${EXTERNAL_DIR}/Vulkan-Loader)
79
add_subdirectory (${EXTERNAL_DIR}/imgui)
810

0 commit comments

Comments
 (0)