Skip to content

Commit

Permalink
Use builtin LLVM and add setup job.
Browse files Browse the repository at this point in the history
  • Loading branch information
crud89 committed Dec 13, 2024
1 parent 209a9a7 commit e00b100
Showing 1 changed file with 79 additions and 37 deletions.
116 changes: 79 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,69 @@ jobs:
comment-id: ${{ github.event.comment.id }}
reactions: 'rocket'

# Test job.
# ------------------------------------- Toolchain setup -------------------------------------
setup:
name: run-setup
needs: verify
if: ${{ contains(needs.verify.outputs.commands, 'test') || contains(needs.verify.outputs.commands, 'tidy') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
name: [ windows-latest ]
include:
- name: windows-latest
os: windows-latest
#- name: ubuntu-latest
# os: ubuntu-latest

steps:
- name: Setup Vulkan SDK
uses: jakoch/[email protected]
with:
vulkan_version: ${{ env.vulkanSdkVersion }}
install_runtime: true
cache: true
stripdown: true

- name: Lookup Mesa3D cache
uses: actions/cache@v4
id: lookup-mesa
with:
key: ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}
path: ${{ github.workspace }}/dep/mesa/
lookup-only: true

- name: Download Mesa3D driver
uses: robinraju/[email protected]
if: steps.lookup-mesa.outputs.cache-hit != 'true'
with:
repository: 'pal1000/mesa-dist-win'
tag: '${{ env.mesaDriverVersion }}'
fileName: 'mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
out-file-path: 'dep/mesa/' # ${{ github.workspace }} is prefixed automatically.
extract: false # 7zip is not supported by this extension, so we have to do it on our own later.

- name: Decompress Mesa3D driver
working-directory: '${{ github.workspace }}/dep/mesa/'
if: steps.lookup-mesa.outputs.cache-hit != 'true'
shell: bash
run: |
7z x '${{ github.workspace }}/dep/mesa/mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
rm '${{ github.workspace }}/dep/mesa/mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
- name: Cache Mesa3D
uses: actions/cache/save@v4
if: steps.lookup-mesa.outputs.cache-hit != 'true'
with:
path: ${{ github.workspace }}/dep/mesa/
key: ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}

# ------------------------------------- Test job -------------------------------------
test:
name: run-tests
needs: verify
needs: [ verify, setup ]
if: ${{ contains(needs.verify.outputs.commands, 'test') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down Expand Up @@ -168,7 +227,7 @@ jobs:
submodules: true

- name: Setup Vulkan SDK
uses: jakoch/[email protected].0
uses: jakoch/[email protected].4
with:
vulkan_version: ${{ env.vulkanSdkVersion }}
install_runtime: true
Expand All @@ -182,34 +241,25 @@ jobs:
choco install opencppcoverage
echo "C:\Program Files\OpenCppCoverage" >> $GITHUB_PATH
- name: Install LLVM and Clang
if: ${{ matrix.compiler == 'clang' }}
uses: KyleMayes/install-llvm-action@v2
with:
version: "19"
- name: Update LLVM
if: ${{ matrix.compiler }} == 'clang'
run: choco upgrade llvm

- name: Setup build and test environment
id: setup-environment
shell: bash
run: |
echo "VCPKG_FEATURE_FLAGS=manifests" >> $env:GITHUB_ENV
echo "C:\msys64\ucrt64\bin" >> $GITHUB_PATH
#echo "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
- name: Download Mesa3D driver
uses: robinraju/[email protected]
- name: Restore Mesa3D
uses: actions/cache/restore@v4
with:
repository: 'pal1000/mesa-dist-win'
tag: '${{ env.mesaDriverVersion }}'
fileName: 'mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
out-file-path: 'dep/mesa/' # ${{ github.workspace }} is prefixed automatically.
extract: false # 7zip is not supported by this extension, so we have to do it on our own later.

- name: Decompress Mesa3D driver
working-directory: '${{ github.workspace }}/dep/mesa/'
run: |
7z x '${{ github.workspace }}/dep/mesa/mesa3d-${{ env.mesaDriverVersion }}-release-msvc.7z'
path: ${{ github.workspace }}/dep/mesa/
key: ${{ matrix.os }}-mesa3d-${{ env.mesaDriverVersion }}

- name: Install and Test Mesa3D driver
working-directory: '${{ github.workspace }}/dep/mesa/'
Expand All @@ -222,24 +272,18 @@ jobs:
reg add "HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers" /v 'C:\VulkanSDK\${{ env.vulkanSdkVersion }}\Bin32\VkLayer_khronos_validation.json' /t REG_DWORD /d 0 /f /reg:64
C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x64\vulkaninfo.exe --summary
- name: Retrieve latest CMake build
uses: lukka/get-cmake@latest

- name: Restore or build vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{ github.workspace }}/src/Modules/vcpkg'
vcpkgJsonGlob: '${{ github.workspace }}/src/vcpkg.json'

- name: Build Runtime and Tests
id: build-with-cmake
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/src/CMakeLists.txt'
configurePreset: '${{ matrix.configuration }}'
buildPreset: '${{ matrix.configuration }}'
#testPreset: '${{ matrix.configuration }}'
#testPresetAdditionalArgs: "[ '--output-on-failure', '--timeout', '10' ]"

- name: Run tests
working-directory: "${{ github.workspace }}/out/build/${{ matrix.configuration }}"
Expand Down Expand Up @@ -303,10 +347,10 @@ jobs:
output: |
{ "summary": ${{ toJSON(env.SUMMARY) }} }
# Run static code analysis
# ------------------------------------- Static code analysis -------------------------------------
tidy:
name: run-tidy
needs: verify
needs: [ verify, setup ]
if: ${{ contains(needs.verify.outputs.commands, 'tidy') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down Expand Up @@ -373,19 +417,17 @@ jobs:
submodules: true

- name: Setup Vulkan SDK
uses: jakoch/[email protected].0
uses: jakoch/[email protected].4
with:
vulkan_version: ${{ env.vulkanSdkVersion }}
install_runtime: true
cache: true
stripdown: false

- name: Install LLVM and Clang
if: ${{ matrix.compiler == 'clang' }}
uses: KyleMayes/install-llvm-action@v2
with:
version: "19"

- name: Update LLVM
if: ${{ matrix.compiler }} == 'clang'
run: choco upgrade llvm

- name: Setup build and test environment
id: setup-environment
shell: bash
Expand All @@ -394,6 +436,7 @@ jobs:
#echo "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime" >> $GITHUB_PATH # Somehow does not get picked up by the MSVC development environment.
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
cp "C:\VulkanSDK\${{ env.vulkanSdkVersion }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
echo "C:\msys64\ucrt64\bin" >> $GITHUB_PATH
- name: Retrieve latest CMake build
uses: lukka/get-cmake@latest
Expand All @@ -404,13 +447,12 @@ jobs:
vcpkgDirectory: '${{ github.workspace }}/src/Modules/vcpkg'
vcpkgJsonGlob: '${{ github.workspace }}/src/vcpkg.json'

- name: Build Runtime and Tests
- name: Build Runtime and Samples
id: build-with-cmake
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/src/CMakeLists.txt'
configurePreset: '${{ matrix.configuration }}'
configurePresetAdditionalArgs: "['-DLITEFX_BUILD_EXAMPLES=ON']"
buildPreset: '${{ matrix.configuration }}'

- name: Collect code analysis results
Expand Down

0 comments on commit e00b100

Please sign in to comment.