Merge branch 'main' of https://github.com/cpp20120/MetaUtils #6
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: CMake CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| preset: [vcpkg-debug, vcpkg-release] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies (Ubuntu) | |
| run: | | |
| sudo apt update | |
| sudo apt install -y ninja-build lcov gcovr clang cmake doxygen graphviz nsis | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
| vcpkgJsonGlob: '**/vcpkg.json' | |
| - name: Configure (Linux ${{ matrix.preset }}) | |
| run: cmake --preset ${{ matrix.preset }} | |
| - name: Build | |
| run: cmake --build --preset build-${{ matrix.preset }} | |
| - name: Run tests | |
| run: ctest --preset test-all | |
| - name: Generate Coverage | |
| if: matrix.preset == 'vcpkg-debug' | |
| run: | | |
| lcov --capture --directory . --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' '*/vcpkg/*' --output-file coverage.info | |
| lcov --list coverage.info | |
| build-sanitizers: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| sanitizer: [address, thread, undefined] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt install -y ninja-build clang cmake | |
| - name: Configure with sanitizer | |
| run: cmake --preset debug-sanitize-${{ matrix.sanitizer }} | |
| - name: Build | |
| run: cmake --build --preset build-debug-sanitize-${{ matrix.sanitizer }} | |
| - name: Run tests | |
| run: ctest --preset test-sanitize-${{ matrix.sanitizer }} | |
| build-windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| preset: [vcpkg-debug, vcpkg-release] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
| vcpkgJsonGlob: '**/vcpkg.json' | |
| - name: Configure (Windows ${{ matrix.preset }}) | |
| run: cmake --preset ${{ matrix.preset }} | |
| - name: Build | |
| run: cmake --build --preset build-${{ matrix.preset }} | |
| - name: Run tests | |
| run: ctest --preset test-all | |
| - name: Build Installer (NSIS) | |
| if: matrix.preset == 'vcpkg-release' | |
| run: makensis setup.nsi | |
| build-macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| preset: [vcpkg-debug, vcpkg-release] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: brew install ninja cmake doxygen graphviz | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgDirectory: '${{ github.workspace }}/vcpkg' | |
| vcpkgJsonGlob: '**/vcpkg.json' | |
| - name: Configure (macOS ${{ matrix.preset }}) | |
| run: cmake --preset ${{ matrix.preset }} | |
| - name: Build | |
| run: cmake --build --preset build-${{ matrix.preset }} | |
| - name: Run tests | |
| run: ctest --preset test-all | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t game_engine_build . | |
| - name: Run tests inside container | |
| run: docker run --rm game_engine_build ctest --preset test-all |