cmake.yml 6.4 KB

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