Skip to content

Implement Low-level Graphics API #19

Implement Low-level Graphics API

Implement Low-level Graphics API #19

name: msvc-2022:windows
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build_mode: ["Release", "Debug"]
os: ["windows-2022", "windows-2019"]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Cache and Install Dependencies
id: cache-and-install
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/SDKs
${{ github.workspace }}/deps
${{ github.workspace }}/tools
./third_party
key: ${{ matrix.os }}-${{ hashFiles('**/lockfiles') }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('vcpkg.json') }}
- name: Install Vulkan SDK
run: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.239.0/windows/VulkanSDK-1.3.239.0-Installer.exe" -OutFile "vulkan_installer.exe" && ./vulkan_installer.exe --root ${{ github.workspace }}/SDKs/VulkanSDK/1.3.239.0 --accept-licenses --default-answer --confirm-command install
if: steps.cache-and-install.outputs.cache-hit != 'true'
- name: Build SDL3
run: |
git clone --depth=1 https://github.com/libsdl-org/SDL ${{ github.workspace }}/deps/SDL
cd ${{ github.workspace }}/deps/SDL && mkdir build
cd build && cmake .. -DSDL_STATIC=ON
if: steps.cache-and-install.outputs.cache-hit != 'true'
- name: Install SDL3
run: |
cd ${{ github.workspace }}/deps/SDL/build && cmake --build . --config Release --target install
- name: Install VCPKG
run: |
git clone --depth=1 https://github.com/microsoft/vcpkg.git ${{ github.workspace }}/tools/vcpkg
cd ${{ github.workspace }}/tools/vcpkg && ./bootstrap-vcpkg.bat -disableMetrics
if: steps.cache-and-install.outputs.cache-hit != 'true'
- name: Install Dependencies, Configure, and Build Ashura
env:
VULKAN_SDK: ${{ github.workspace }}/SDKs/VulkanSDK/1.3.239.0
run: |
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DVCPKG_HOST_TRIPLET=x64-windows -DVCPKG_INSTALLED_DIR=${{ github.workspace }}/tools/vcpkg/installed
cmake --build . --config ${{ matrix.build_mode }}
- name: Run Ashura Test
run: |
cd build/ashura/${{ matrix.build_mode }}/ && ./ashura_test.exe