cmake.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. name: CMake
  2. on:
  3. workflow_run:
  4. workflows: [tests]
  5. branches: [main]
  6. types: [completed]
  7. workflow_dispatch:
  8. jobs:
  9. build-x11:
  10. if: ${{ github.event.workflow_run.conclusion == 'success' }}
  11. strategy:
  12. matrix:
  13. os: [ubuntu-22.04, ubuntu-24.04]
  14. build_type: [Release, Debug]
  15. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  16. # You can convert this to a matrix build if you need cross-platform coverage.
  17. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  18. runs-on: ${{ matrix.os }}
  19. steps:
  20. - uses: actions/checkout@v3
  21. with:
  22. submodules: true
  23. # cache some build information
  24. - name: ccache
  25. uses: hendrikmuhs/ccache-action@v1.2
  26. with:
  27. key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
  28. - name: Install dependencies
  29. if: matrix.os == 'ubuntu-22.04'
  30. 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
  31. - name: Install dependencies
  32. if: matrix.os == 'ubuntu-24.04'
  33. 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
  34. - name: Configure CMake
  35. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  36. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  37. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
  38. - name: Build
  39. # Build your program with the given configuration
  40. run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
  41. build-x11-wayland:
  42. if: ${{ github.event.workflow_run.conclusion == 'success' }}
  43. permissions:
  44. actions: read
  45. contents: read
  46. security-events: write
  47. strategy:
  48. matrix:
  49. os: [ubuntu-22.04, ubuntu-24.04]
  50. build_type: [Release, Debug]
  51. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  52. # You can convert this to a matrix build if you need cross-platform coverage.
  53. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  54. runs-on: ${{ matrix.os }}
  55. steps:
  56. - uses: actions/checkout@v3
  57. with:
  58. submodules: true
  59. - name: ccache
  60. uses: hendrikmuhs/ccache-action@v1.2
  61. with:
  62. key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
  63. - name: Initialize CodeQL
  64. # Initializes the CodeQL tools for scanning.
  65. uses: github/codeql-action/init@v3
  66. if: ${{ matrix.os == 'ubuntu-24.04' && matrix.build_type == 'Debug' }}
  67. with:
  68. languages: 'cpp'
  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=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
  79. - name: Build
  80. # Build your program with the given configuration
  81. run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
  82. - name: Perform CodeQL Analysis
  83. if: ${{ matrix.os == 'ubuntu-24.04' && matrix.build_type == 'Debug' }}
  84. uses: github/codeql-action/analyze@v3
  85. build-wayland:
  86. if: ${{ github.event.workflow_run.conclusion == 'success' }}
  87. strategy:
  88. matrix:
  89. os: [ubuntu-22.04, ubuntu-24.04]
  90. build_type: [Release, Debug]
  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: ccache
  100. uses: hendrikmuhs/ccache-action@v1.2
  101. with:
  102. key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.build_type }} # Eg. "some_build-ubuntu-latest"
  103. - name: Install dependencies
  104. if: matrix.os == 'ubuntu-22.04'
  105. 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
  106. - name: Install dependencies
  107. if: matrix.os == 'ubuntu-24.04'
  108. 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
  109. - name: Configure CMake
  110. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  111. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  112. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
  113. - name: Build
  114. # Build your program with the given configuration
  115. run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}