cmake.yml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  1. name: CMake
  2. on:
  3. release:
  4. types: [ published ]
  5. workflow_dispatch:
  6. permissions:
  7. contents: read
  8. jobs:
  9. formatting:
  10. name: Formatting check
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  14. - name: Run clang-format style check for C/C++ programs.
  15. uses: jidicula/clang-format-action@654a770daa28443dd111d133e4083e21c1075674 # v4.18.0
  16. with:
  17. check-path: "src"
  18. exclude-regex: "(src/External)"
  19. - run: echo "Formatted with clang-format version ${{ steps.clang-format.outputs.clang-format-version }}"
  20. tests:
  21. #needs: formatting
  22. env:
  23. BUILD_TYPE: Release
  24. strategy:
  25. matrix:
  26. os: [ubuntu-24.04]
  27. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  28. # You can convert this to a matrix build if you need cross-platform coverage.
  29. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  30. runs-on: ${{ matrix.os }}
  31. steps:
  32. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  33. with:
  34. submodules: true
  35. # cache some build information
  36. - name: ccache
  37. uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
  38. with:
  39. key: ${{ github.job }}-${{ matrix.os }}
  40. - name: Install dependencies
  41. run: sudo apt-get update && sudo apt-get -y install libgl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libglm-dev libglfw3-dev libmpv-dev mpv libmpv2 libfftw3-dev libfreetype-dev libdbus-1-dev libnode-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}} -DBUILD_TESTING=1 -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
  46. - name: Build
  47. # Build your program with the given configuration
  48. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target tests --verbose
  49. - name: Run tests
  50. # Run the unit tests available
  51. run: ${{github.workspace}}/build/output/tests
  52. build:
  53. needs: tests
  54. permissions:
  55. actions: read
  56. contents: read
  57. security-events: write
  58. strategy:
  59. matrix:
  60. include:
  61. - build_type: Release
  62. variant: kde
  63. disable_kde: 'OFF'
  64. - build_type: Release
  65. variant: generic
  66. disable_kde: 'ON'
  67. - build_type: Debug
  68. variant: kde
  69. disable_kde: 'OFF'
  70. runs-on: ubuntu-24.04
  71. steps:
  72. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  73. with:
  74. submodules: true
  75. - name: ccache
  76. uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
  77. with:
  78. key: ${{ github.job }}-ubuntu-24.04-${{ matrix.build_type }}-${{ matrix.variant }}
  79. - name: Initialize CodeQL
  80. # Initializes the CodeQL tools for scanning.
  81. uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
  82. if: ${{ matrix.build_type == 'Debug' }}
  83. with:
  84. languages: 'cpp'
  85. - name: Install dependencies
  86. run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcomposite-dev libxdamage-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 libfreetype-dev libdbus-1-dev libnode-dev wayland-scanner++ wayland-protocols libwayland-dev
  87. - name: Configure CMake
  88. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DDISABLE_KDE_FEATURES=${{matrix.disable_kde}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
  89. - name: Build
  90. run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --parallel $(nproc) --verbose
  91. - name: Perform CodeQL Analysis
  92. if: ${{ matrix.build_type == 'Debug' }}
  93. uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
  94. - name: Package
  95. if: ${{ matrix.build_type == 'Release' }}
  96. run: tools/package_release.sh build linux-wallpaperengine-${{ matrix.variant }}-ubuntu-24.04-x86_64 "$RUNNER_TEMP"
  97. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
  98. if: ${{ matrix.build_type == 'Release' }}
  99. with:
  100. name: linux-wallpaperengine-${{ matrix.variant }}
  101. path: ${{ runner.temp }}/linux-wallpaperengine-${{ matrix.variant }}-ubuntu-24.04-x86_64.tar.gz
  102. if-no-files-found: error
  103. # Arch has V8's shared library only in the AUR (libnode, Node.js built with --shared). The package is kept as an
  104. # asset of the "libnode-arch" release, so the hour-long build only happens when the AUR bumps the version. A new
  105. # version starts from the previous one's ccache. LTO is off, makepkg's own -flto without node's --enable-lto
  106. # handling loses V8's assembly stack scanner at link time; debug is off since -g makes V8 much slower to compile
  107. libnode-arch:
  108. runs-on: ubuntu-24.04
  109. container: archlinux:latest
  110. permissions:
  111. contents: write
  112. env:
  113. GH_TOKEN: ${{ github.token }}
  114. steps:
  115. - name: Install dependencies
  116. run: >-
  117. pacman -Syu --noconfirm --needed base-devel curl jq ccache ada brotli c-ares icu libffi libnghttp2
  118. libnghttp3 libngtcp2 libuv openssl simdjson zlib zstd ninja procps-ng python
  119. - name: Fetch libnode PKGBUILD
  120. id: libnode
  121. run: |
  122. mkdir -p /tmp/libnode /tmp/libnode-pkg
  123. curl -fsSL "https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=libnode" -o /tmp/libnode/PKGBUILD
  124. sed -i -e '/--enable-lto/d' -e "/^makedepends=/i options=('!lto' '!debug')" /tmp/libnode/PKGBUILD
  125. # parsed, not sourced (that would run AUR code as root)
  126. pkgver="$(sed -n 's/^pkgver=//p' /tmp/libnode/PKGBUILD | tr -d "'\"")"
  127. pkgrel="$(sed -n 's/^pkgrel=//p' /tmp/libnode/PKGBUILD | tr -d "'\"")"
  128. [ -n "$pkgver" ] && [ -n "$pkgrel" ] || { echo "no pkgver/pkgrel in the libnode PKGBUILD" >&2; exit 1; }
  129. echo "version=$pkgver-$pkgrel" >> "$GITHUB_OUTPUT"
  130. echo "asset=libnode-$pkgver-$pkgrel-x86_64.pkg.tar.zst" >> "$GITHUB_OUTPUT"
  131. - name: Download libnode from the release
  132. id: prebuilt
  133. run: |
  134. asset="${{ steps.libnode.outputs.asset }}"
  135. if curl -fsSL "https://github.com/$GITHUB_REPOSITORY/releases/download/libnode-arch/$asset" -o "/tmp/libnode-pkg/$asset"; then
  136. echo "hit=true" >> "$GITHUB_OUTPUT"
  137. else
  138. rm -f "/tmp/libnode-pkg/$asset"
  139. echo "hit=false" >> "$GITHUB_OUTPUT"
  140. fi
  141. - name: Restore ccache
  142. if: steps.prebuilt.outputs.hit != 'true'
  143. uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
  144. with:
  145. path: /tmp/libnode-ccache
  146. key: libnode-ccache-${{ steps.libnode.outputs.version }}
  147. restore-keys: libnode-ccache-
  148. - name: Build libnode
  149. if: steps.prebuilt.outputs.hit != 'true'
  150. run: |
  151. useradd -m builder
  152. mkdir -p /tmp/libnode-ccache
  153. chown -R builder /tmp/libnode /tmp/libnode-ccache
  154. su builder -c 'export CCACHE_DIR=/tmp/libnode-ccache CCACHE_MAXSIZE=2G CCACHE_COMPILERCHECK=content
  155. PATH=/usr/lib/ccache/bin:$PATH; ccache -z; cd /tmp/libnode && makepkg --noconfirm --nodeps; ccache -s'
  156. cp /tmp/libnode/libnode-[0-9]*.pkg.tar.zst "/tmp/libnode-pkg/${{ steps.libnode.outputs.asset }}"
  157. # saved right away, a later failure in this run must not throw the build away
  158. - name: Save ccache
  159. if: steps.prebuilt.outputs.hit != 'true'
  160. uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
  161. with:
  162. path: /tmp/libnode-ccache
  163. key: libnode-ccache-${{ steps.libnode.outputs.version }}
  164. - name: Publish libnode to the release
  165. if: steps.prebuilt.outputs.hit != 'true'
  166. run: |
  167. asset="${{ steps.libnode.outputs.asset }}"
  168. api="https://api.github.com/repos/$GITHUB_REPOSITORY"
  169. auth="Authorization: Bearer $GH_TOKEN"
  170. rel="$(curl -sS -H "$auth" "$api/releases/tags/libnode-arch")"
  171. id="$(echo "$rel" | jq -r '.id // empty')"
  172. if [ -z "$id" ]; then
  173. id="$(curl -fsS -H "$auth" -X POST "$api/releases" \
  174. -d '{"tag_name":"libnode-arch","name":"libnode (Arch)","body":"Prebuilt AUR libnode packages for the CI, not an application release.","prerelease":true}' | jq -r .id)"
  175. fi
  176. old="$(curl -fsS -H "$auth" "$api/releases/$id/assets?per_page=100" | jq -r --arg n "$asset" '.[] | select(.name == $n) | .id')"
  177. for a in $old; do curl -fsS -H "$auth" -X DELETE "$api/releases/assets/$a"; done
  178. curl -fsS -H "$auth" -H "Content-Type: application/octet-stream" --data-binary "@/tmp/libnode-pkg/$asset" \
  179. "https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$id/assets?name=$asset" > /dev/null
  180. # for the Arch distribution builds and the smoke test's fresh Arch container
  181. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
  182. with:
  183. name: libnode-arch
  184. path: /tmp/libnode-pkg/libnode-[0-9]*.pkg.tar.zst
  185. if-no-files-found: error
  186. distro-build:
  187. needs: [tests, libnode-arch]
  188. strategy:
  189. fail-fast: false
  190. matrix:
  191. distro: [fedora-44, arch]
  192. variant: [kde, generic]
  193. include:
  194. - distro: arch
  195. image: archlinux:latest
  196. # libnode comes from the libnode-arch job, these are its dependencies plus CEF's
  197. install: >-
  198. pacman -Syu --noconfirm --needed git base-devel curl cmake glew freeglut sdl2-compat lz4 zlib ffmpeg glm
  199. glfw mpv libpulse freetype2 harfbuzz dbus wayland wayland-protocols mesa libxrandr libxinerama
  200. libxcursor libxi libxxf86vm fftw gmp nss at-spi2-core libcups libxcomposite libxdamage libxkbcommon
  201. pango cairo alsa-lib libdrm libxshmfence ada brotli c-ares icu libffi libnghttp2 libnghttp3 libngtcp2
  202. libuv openssl simdjson zstd
  203. - distro: fedora-44
  204. image: fedora:44
  205. install: >-
  206. dnf -y install git gcc gcc-c++ make cmake pkgconf-pkg-config binutils tar gzip
  207. libXrandr-devel libXinerama-devel libXcomposite-devel libXdamage-devel libXcursor-devel libXi-devel libXxf86vm-devel
  208. mesa-libGL-devel mesa-libEGL-devel glew-devel freeglut-devel sdl2-compat-devel lz4-devel
  209. zlib-ng-compat-devel ffmpeg-free-devel glm-devel glfw-devel mpv-devel pulseaudio-libs-devel
  210. freetype-devel harfbuzz-devel dbus-devel wayland-devel wayland-protocols-devel fftw-devel gmp-devel
  211. nodejs24-devel
  212. runs-on: ubuntu-24.04
  213. container: ${{ matrix.image }}
  214. steps:
  215. # git has to be there before checkout, otherwise it falls back to a tarball without submodules
  216. - name: Install dependencies
  217. run: ${{ matrix.install }}
  218. - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
  219. if: matrix.distro == 'arch'
  220. with:
  221. name: libnode-arch
  222. path: /tmp/libnode-pkg
  223. - name: Install libnode
  224. if: matrix.distro == 'arch'
  225. run: pacman -U --noconfirm /tmp/libnode-pkg/libnode-[0-9]*.pkg.tar.zst
  226. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  227. with:
  228. submodules: true
  229. - name: Configure CMake
  230. run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DDISABLE_KDE_FEATURES=${{ matrix.variant == 'generic' && 'ON' || 'OFF' }}
  231. - name: Build
  232. run: cmake --build build --parallel $(nproc)
  233. - name: Package
  234. run: tools/package_release.sh build linux-wallpaperengine-${{ matrix.variant }}-${{ matrix.distro }}-x86_64 "$RUNNER_TEMP"
  235. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
  236. with:
  237. name: linux-wallpaperengine-${{ matrix.variant }}-${{ matrix.distro }}
  238. path: ${{ runner.temp }}/linux-wallpaperengine-${{ matrix.variant }}-${{ matrix.distro }}-x86_64.tar.gz
  239. if-no-files-found: error
  240. # one tarball for every distribution: built on Debian 12 (glibc 2.36, the oldest base with FFmpeg 5.1 and a
  241. # V8 >= 10.2 libnode), every library that isn't the system's bundled, glibc floor 2.35 (Ubuntu 22.04), see
  242. # tools/package_release.sh
  243. portable:
  244. needs: tests
  245. strategy:
  246. matrix:
  247. variant: [kde, generic]
  248. runs-on: ubuntu-24.04
  249. container: debian:12
  250. steps:
  251. - name: Install dependencies
  252. env:
  253. DEBIAN_FRONTEND: noninteractive
  254. run: >-
  255. apt-get update && apt-get -y install --no-install-recommends git ca-certificates curl build-essential
  256. cmake pkg-config patchelf python3 binutils libxrandr-dev libxinerama-dev libxcomposite-dev libxdamage-dev libxcursor-dev libxi-dev
  257. libgl-dev libegl-dev libglew-dev freeglut3-dev libsdl2-dev liblz4-dev libavcodec-dev libavformat-dev
  258. libavutil-dev libswscale-dev libswresample-dev libxxf86vm-dev libglm-dev libglfw3-dev libmpv-dev
  259. libpulse-dev libfftw3-dev libfreetype-dev libharfbuzz-dev libdbus-1-dev libnode-dev libwayland-dev
  260. wayland-protocols libgmp-dev libnss3 libnspr4 libcups2 libatk1.0-0 libatk-bridge2.0-0 libxcomposite1
  261. libxdamage1 libgbm1 libxkbcommon0 libasound2 libpango-1.0-0 libcairo2 libdrm2 libxshmfence1
  262. libatspi2.0-0
  263. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  264. with:
  265. submodules: true
  266. - name: Configure CMake
  267. run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DDISABLE_KDE_FEATURES=${{ matrix.variant == 'generic' && 'ON' || 'OFF' }}
  268. - name: Build
  269. run: cmake --build build --parallel $(nproc)
  270. - name: Package
  271. run: tools/package_release.sh --portable build linux-wallpaperengine-${{ matrix.variant }}-portable-x86_64 "$RUNNER_TEMP"
  272. - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
  273. with:
  274. name: linux-wallpaperengine-${{ matrix.variant }}-portable
  275. path: ${{ runner.temp }}/linux-wallpaperengine-${{ matrix.variant }}-portable-x86_64.tar.gz
  276. if-no-files-found: error
  277. # every release tarball unpacked in a bare container of the distributions it is meant for: libraries resolve
  278. # (portable: with only what a desktop has; distribution builds: plus their packages, found by soname) and
  279. # --help runs
  280. smoke:
  281. needs: [build, distro-build, portable]
  282. strategy:
  283. fail-fast: false
  284. matrix:
  285. include:
  286. - { image: 'ubuntu:22.04', tarball: kde-portable }
  287. - { image: 'ubuntu:22.04', tarball: generic-portable }
  288. - { image: 'ubuntu:24.04', tarball: kde-portable }
  289. - { image: 'ubuntu:26.04', tarball: kde-portable }
  290. - { image: 'debian:12', tarball: kde-portable }
  291. - { image: 'debian:13', tarball: kde-portable }
  292. - { image: 'fedora:43', tarball: kde-portable }
  293. - { image: 'fedora:44', tarball: kde-portable }
  294. - { image: 'fedora:45', tarball: kde-portable }
  295. - { image: 'opensuse/leap:16.0', tarball: kde-portable }
  296. - { image: 'opensuse/tumbleweed', tarball: kde-portable }
  297. - { image: 'archlinux:latest', tarball: kde-portable }
  298. - { image: 'ubuntu:24.04', tarball: kde-ubuntu-24.04 }
  299. - { image: 'fedora:44', tarball: kde-fedora-44 }
  300. - { image: 'archlinux:latest', tarball: kde-arch }
  301. runs-on: ubuntu-24.04
  302. container: ${{ matrix.image }}
  303. steps:
  304. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  305. - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
  306. with:
  307. # the Ubuntu build's artifact has no distribution in its name
  308. name: linux-wallpaperengine-${{ matrix.tarball == 'kde-ubuntu-24.04' && 'kde' || matrix.tarball }}
  309. path: tarball
  310. - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
  311. if: matrix.tarball == 'kde-arch'
  312. with:
  313. name: libnode-arch
  314. path: libnode
  315. - name: Smoke test
  316. run: |
  317. libnode=(libnode/libnode-[0-9]*.pkg.tar.zst)
  318. [ -e "${libnode[0]}" ] && export LIBNODE_PKG="$PWD/${libnode[0]}"
  319. tools/smoke_test_release.sh --install-deps tarball/*.tar.gz
  320. shell: bash
  321. release:
  322. needs: [build, distro-build, portable, smoke]
  323. if: startsWith(github.ref, 'refs/tags/')
  324. runs-on: ubuntu-latest
  325. permissions:
  326. contents: write
  327. steps:
  328. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  329. - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
  330. with:
  331. path: release
  332. merge-multiple: true
  333. - name: Upload to the release
  334. env:
  335. GH_TOKEN: ${{ github.token }}
  336. run: |
  337. # a release made on GitHub already exists, a manual run on a bare tag has none yet
  338. if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
  339. gh release upload "$GITHUB_REF_NAME" --clobber release/*.tar.gz
  340. else
  341. gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --generate-notes release/*.tar.gz
  342. fi
  343. # the -bin package points at the release's portable tarball, so it is updated after the upload
  344. aur:
  345. needs: release
  346. # pre-release tags are no valid pkgver
  347. if: ${{ !github.event.release.prerelease }}
  348. runs-on: ubuntu-latest
  349. env:
  350. HAS_AUR_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY != '' }}
  351. steps:
  352. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  353. - name: Set the version
  354. run: sed -i -e "s/^pkgver=.*/pkgver=${GITHUB_REF_NAME#v}/" -e "s/^pkgrel=.*/pkgrel=1/"
  355. packaging/aur/linux-wallpaperengine-kde-bin/PKGBUILD
  356. - name: Publish linux-wallpaperengine-kde-bin to the AUR
  357. if: env.HAS_AUR_KEY == 'true'
  358. uses: KSXGitHub/github-actions-deploy-aur@084b0d9b15415bf9cdb65d44dad1efe37a354050 # v4.2.0
  359. with:
  360. pkgname: linux-wallpaperengine-kde-bin
  361. pkgbuild: ./packaging/aur/linux-wallpaperengine-kde-bin/PKGBUILD
  362. updpkgsums: true
  363. commit_username: ${{ secrets.AUR_USERNAME }}
  364. commit_email: ${{ secrets.AUR_EMAIL }}
  365. ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
  366. commit_message: Update to ${{ github.ref_name }}
  367. clang-build:
  368. needs: tests
  369. permissions:
  370. actions: read
  371. contents: read
  372. security-events: write
  373. strategy:
  374. matrix:
  375. build_type: [Debug, Release]
  376. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  377. # You can convert this to a matrix build if you need cross-platform coverage.
  378. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  379. runs-on: ubuntu-24.04
  380. steps:
  381. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
  382. with:
  383. submodules: true
  384. - name: ccache
  385. uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
  386. with:
  387. key: ${{ github.job }}-ubuntu-24.04-${{ matrix.build_type }}
  388. - name: Install dependencies
  389. run: sudo apt-get update && sudo apt-get -y install libxrandr-dev libxinerama-dev libxcomposite-dev libxdamage-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 libfreetype-dev libdbus-1-dev libnode-dev wayland-scanner++ wayland-protocols libwayland-dev
  390. - name: Configure CMake
  391. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  392. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  393. run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++
  394. - name: Build
  395. # Build your program with the given configuration
  396. run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose