cmake.yml 6.5 KB

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