cmake.yml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. permissions:
  48. actions: read
  49. contents: read
  50. security-events: write
  51. strategy:
  52. matrix:
  53. os: [ubuntu-22.04, ubuntu-24.04]
  54. language: ['cpp']
  55. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  56. # You can convert this to a matrix build if you need cross-platform coverage.
  57. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  58. runs-on: ${{ matrix.os }}
  59. steps:
  60. - uses: actions/checkout@v3
  61. with:
  62. submodules: true
  63. - name: Install dependencies
  64. if: matrix.os == 'ubuntu-22.04'
  65. 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
  66. - name: Install dependencies
  67. if: matrix.os == 'ubuntu-24.04'
  68. 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
  69. - name: Configure CMake
  70. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  71. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  72. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  73. - name: Build
  74. # Build your program with the given configuration
  75. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
  76. - name: Initialize CodeQL
  77. # Initializes the CodeQL tools for scanning.
  78. uses: github/codeql-action/init@v1
  79. with:
  80. languages: ${{ matrix.language }}
  81. - name: Perform CodeQL Analysis
  82. uses: github/codeql-action/analyze@v2
  83. build-wayland:
  84. strategy:
  85. matrix:
  86. os: [ubuntu-22.04, ubuntu-24.04]
  87. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  88. # You can convert this to a matrix build if you need cross-platform coverage.
  89. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  90. runs-on: ${{ matrix.os }}
  91. steps:
  92. - uses: actions/checkout@v3
  93. with:
  94. submodules: true
  95. - name: Install dependencies
  96. if: matrix.os == 'ubuntu-22.04'
  97. 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
  98. - name: Install dependencies
  99. if: matrix.os == 'ubuntu-24.04'
  100. 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
  101. - name: Configure CMake
  102. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  103. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  104. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
  105. - name: Build
  106. # Build your program with the given configuration
  107. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}