- add logging #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths: | |
- '.github/workflows/**' | |
- 'CMakeLists.txt' | |
- 'DGEngine.core/**' | |
- 'DGEngine.core/CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
pull_request: | |
paths: | |
- '.github/workflows/**' | |
- 'CMakeLists.txt' | |
- 'DGEngine.core/**' | |
- 'DGEngine.core/CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
jobs: | |
build_linux: | |
name: linux build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout DGEngine | |
uses: actions/checkout@v4 | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install Ubuntu dependencies | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev nasm | |
version: 1.0 | |
execute_install_scripts: true | |
- name: Install dependencies | |
run: | | |
vcpkg install ffmpeg[core,avcodec,avdevice,avfilter,avformat,swresample,swscale] physfs sfml --triplet=x64-linux | |
- name: Setup Ninja Build | |
uses: turtlesec-no/get-ninja@main | |
- name: CMake build DGEngine | |
run: | | |
export CC=/usr/bin/gcc-11 | |
export CXX=/usr/bin/g++-11 | |
cmake --preset linux-x64-debug-vcpkg -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake | |
cmake --build --preset linux-x64-debug-vcpkg | |
build_windows: | |
name: windows build | |
runs-on: windows-latest | |
steps: | |
- name: Checkout DGEngine | |
uses: actions/checkout@v4 | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Install dependencies | |
run: vcpkg install catch2 physfs sfml --triplet=x64-windows | |
- name: Setup MSVC | |
uses: TheMrMilchmann/setup-msvc-dev@v2 | |
with: | |
arch: x64 | |
- name: Setup Ninja Build | |
uses: turtlesec-no/get-ninja@main | |
- name: CMake build DGEngine | |
run: | | |
cmake --preset windows-x64-debug -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake | |
cmake --build --preset windows-x64-debug | |
- name: Run tests | |
shell: cmd | |
run: cd test && ..\out\build\windows-x64-debug\test\DGEngine-test.exe |