cmake.yml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. name: CMake
  2. on:
  3. push:
  4. paths:
  5. - 'src/**'
  6. - 'CMakeModules/**'
  7. - CMakeLists.txt
  8. - 'protocols/**'
  9. branches: [ "main" ]
  10. pull_request:
  11. paths:
  12. - 'src/**'
  13. - 'CMakeModules/**'
  14. - CMakeLists.txt
  15. - 'protocols/**'
  16. branches: [ "main" ]
  17. env:
  18. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  19. BUILD_TYPE: Release
  20. jobs:
  21. build-x11:
  22. strategy:
  23. matrix:
  24. os: [ubuntu-22.04, ubuntu-24.04]
  25. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  26. # You can convert this to a matrix build if you need cross-platform coverage.
  27. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  28. runs-on: ${{ matrix.os }}
  29. steps:
  30. - uses: actions/checkout@v3
  31. with:
  32. submodules: true
  33. - name: Install dependencies
  34. if: matrix.os == 'ubuntu-22.04'
  35. 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
  36. - name: Install dependencies
  37. if: matrix.os == 'ubuntu-24.04'
  38. 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
  39. - name: Configure CMake
  40. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  41. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  42. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  43. - name: Build
  44. # Build your program with the given configuration
  45. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  46. build-x11-wayland:
  47. strategy:
  48. matrix:
  49. os: [ubuntu-22.04, ubuntu-24.04]
  50. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  51. # You can convert this to a matrix build if you need cross-platform coverage.
  52. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  53. runs-on: ${{ matrix.os }}
  54. steps:
  55. - uses: actions/checkout@v3
  56. with:
  57. submodules: true
  58. - name: Install dependencies
  59. if: matrix.os == 'ubuntu-22.04'
  60. 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
  61. - name: Install dependencies
  62. if: matrix.os == 'ubuntu-24.04'
  63. 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
  64. - name: Configure CMake
  65. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  66. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  67. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  68. - name: Build
  69. # Build your program with the given configuration
  70. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  71. - name: Perform CodeQL Analysis
  72. uses: github/codeql-action/analyze@v2
  73. build-wayland:
  74. strategy:
  75. matrix:
  76. os: [ubuntu-22.04, ubuntu-24.04]
  77. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  78. # You can convert this to a matrix build if you need cross-platform coverage.
  79. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  80. runs-on: ${{ matrix.os }}
  81. steps:
  82. - uses: actions/checkout@v3
  83. with:
  84. submodules: true
  85. - name: Install dependencies
  86. if: matrix.os == 'ubuntu-22.04'
  87. 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
  88. - name: Install dependencies
  89. if: matrix.os == 'ubuntu-24.04'
  90. 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
  91. - name: Configure CMake
  92. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  93. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  94. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  95. - name: Build
  96. # Build your program with the given configuration
  97. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}