| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- name: CMake
- on:
- push:
- paths:
- - '.github/workflows/cmake.yml'
- - 'src/**'
- - 'CMakeModules/**'
- - CMakeLists.txt
- - 'protocols/**'
- branches: [ main ]
- pull_request:
- paths:
- - '.github/workflows/cmake.yml'
- - 'src/**'
- - 'CMakeModules/**'
- - CMakeLists.txt
- - 'protocols/**'
- branches: [ main ]
- workflow_dispatch:
- jobs:
- tests:
- env:
- BUILD_TYPE: Release
- strategy:
- matrix:
- os: [ubuntu-24.04]
- # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
- # You can convert this to a matrix build if you need cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- # cache some build information
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.os }} # Eg. "some_build-ubuntu-latest"
- - name: Install dependencies
- if: matrix.os == 'ubuntu-24.04'
- run: sudo apt-get update && sudo apt-get -y install libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libfftw3-dev
- - name: Configure CMake
- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTING=1
- - name: Build
- # Build your program with the given configuration
- run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target tests
- - name: Run tests
- # Run the unit tests available
- run: ${{github.workspace}}/build/output/tests
- build-x11:
- needs: tests
- strategy:
- matrix:
- os: [ubuntu-22.04, ubuntu-24.04]
- build_type: [Release, Debug]
- # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
- # You can convert this to a matrix build if you need cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- # cache some build information
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
- - name: Install dependencies
- if: matrix.os == 'ubuntu-22.04'
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev
- - name: Install dependencies
- if: matrix.os == 'ubuntu-24.04'
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev
- - name: Configure CMake
- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- - name: Build
- # Build your program with the given configuration
- run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- build-x11-wayland:
- needs: tests
- permissions:
- actions: read
- contents: read
- security-events: write
- strategy:
- matrix:
- os: [ubuntu-22.04, ubuntu-24.04]
- build_type: [Release, Debug]
- # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
- # You can convert this to a matrix build if you need cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
- - name: Initialize CodeQL
- # Initializes the CodeQL tools for scanning.
- uses: github/codeql-action/init@v3
- if: ${{ matrix.os == 'ubuntu-24.04' && matrix.build_type == 'Debug' }}
- with:
- languages: 'cpp'
- - name: Install dependencies
- if: matrix.os == 'ubuntu-22.04'
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev wayland-scanner++ wayland-protocols libwayland-dev
- - name: Install dependencies
- if: matrix.os == 'ubuntu-24.04'
- run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev wayland-scanner++ wayland-protocols libwayland-dev
- - name: Configure CMake
- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- - name: Build
- # Build your program with the given configuration
- run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
- - name: Perform CodeQL Analysis
- if: ${{ matrix.os == 'ubuntu-24.04' && matrix.build_type == 'Debug' }}
- uses: github/codeql-action/analyze@v3
- build-wayland:
- needs: tests
- strategy:
- matrix:
- os: [ubuntu-22.04, ubuntu-24.04]
- build_type: [Release, Debug]
- # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
- # You can convert this to a matrix build if you need cross-platform coverage.
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- runs-on: ${{ matrix.os }}
- steps:
- - uses: actions/checkout@v3
- with:
- submodules: true
- - name: ccache
- uses: hendrikmuhs/ccache-action@v1.2
- with:
- key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
- - name: Install dependencies
- if: matrix.os == 'ubuntu-22.04'
- run: sudo apt-get update && sudo apt-get -y install wayland-scanner++ wayland-protocols libwayland-dev libwayland-egl-backend-dev libglfw3-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libmpv-dev mpv libmpv1 libpulse-dev libpulse0 libfftw3-dev
- - name: Install dependencies
- if: matrix.os == 'ubuntu-24.04'
- run: sudo apt-get update && sudo apt-get -y install wayland-scanner++ wayland-protocols libwayland-dev libwayland-egl-backend-dev libglfw3-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libmpv-dev mpv libmpv2 libpulse-dev libpulse0 libfftw3-dev
- - name: Configure CMake
- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
- run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
- - name: Build
- # Build your program with the given configuration
- run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
|