- fix build and CI #24
This file contains hidden or 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/**' | |
| jobs: | |
| build: | |
| name: ${{ matrix.name }} build | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| APP_NAME: DGEngine | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux | |
| os: ubuntu-latest | |
| preset: linux-x64-debug-vcpkg | |
| triplet: x64-linux | |
| - name: Windows x64 | |
| arch: x64 | |
| os: windows-latest | |
| preset: windows-x64-debug | |
| triplet: x64-windows | |
| steps: | |
| - name: Checkout ${{ env.APP_NAME }} | |
| uses: actions/checkout@v4 | |
| - name: Install Ubuntu dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| 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 | |
| uses: johnwason/vcpkg-action@v7 | |
| id: vcpkg | |
| with: | |
| pkgs: ${{ runner.os == 'Linux' && 'ffmpeg[core,avcodec,avdevice,avfilter,avformat,swresample,swscale]' || '' }} physfs sfml[audio,graphics,window] | |
| triplet: ${{ matrix.triplet }} | |
| extra-args: --overlay-ports=../vcpkg/ports | |
| cache-key: vcpkg-${{ matrix.triplet }}-main | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| vcpkg-subdir: 'vcpkg-bin' | |
| revision: 'b2cb0da531c2f1f740045bfe7c4dac59f0b2b69c' # 2024.11.16 | |
| - name: Setup MSVC (Windows) | |
| if: runner.os == 'Windows' | |
| uses: TheMrMilchmann/setup-msvc-dev@v3 | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Setup Ninja Build | |
| uses: turtlesec-no/get-ninja@main | |
| - name: CMake build ${{ env.APP_NAME }} | |
| run: | | |
| cmake --preset ${{ matrix.preset }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg-bin/scripts/buildsystems/vcpkg.cmake | |
| cmake --build --preset ${{ matrix.preset }} | |
| - name: Run tests (Windows) | |
| if: runner.os == 'Windows' | |
| run: ctest --preset ${{ matrix.preset }} |