You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

689 lines
27KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 15
  5. CARDINAL_UNDER_WINE: 1
  6. CIBUILD: true
  7. DEBIAN_FRONTEND: noninteractive
  8. LIBGL_ALWAYS_SOFTWARE: true
  9. PAWPAW_CI: 1
  10. PAWPAW_FAST_MATH: 1
  11. PAWPAW_SKIP_GLIB: 1
  12. PAWPAW_SKIP_LTO: 1
  13. PAWPAW_SKIP_LV2: 1
  14. PAWPAW_SKIP_OPENSSL: 1
  15. PAWPAW_SKIP_SAMPLERATE: 1
  16. PAWPAW_SKIP_TESTS: 1
  17. jobs:
  18. linux:
  19. strategy:
  20. matrix:
  21. target: [aarch64, armhf, i686, riscv64, x86_64]
  22. runs-on: ubuntu-latest
  23. container:
  24. image: ubuntu:22.04
  25. steps:
  26. - name: Install git
  27. run: |
  28. apt-get update -qq && apt-get install -yqq --no-install-recommends ca-certificates curl git openssl
  29. curl -sLO https://launchpad.net/~kxstudio-debian/+archive/ubuntu/toolchain/+files/git_2.34.1-1ubuntu1~bpo20.04.1~ppa1_amd64.deb
  30. curl -sLO https://launchpad.net/~kxstudio-debian/+archive/ubuntu/toolchain/+files/git-man_2.34.1-1ubuntu1~bpo20.04.1~ppa1_all.deb
  31. dpkg -i *.deb
  32. rm *.deb
  33. - uses: actions/checkout@v4
  34. with:
  35. submodules: recursive
  36. - name: Set up build cache
  37. id: cache
  38. uses: actions/cache@v4
  39. with:
  40. path: |
  41. ~/PawPawBuilds
  42. src/Rack/dep/bin
  43. src/Rack/dep/include
  44. src/Rack/dep/lib
  45. src/Rack/dep/share
  46. src/Rack/dep/jansson-2.12
  47. src/Rack/dep/libarchive-3.4.3
  48. src/Rack/dep/libsamplerate-0.1.9
  49. src/Rack/dep/zstd-1.4.5
  50. key: linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  51. - name: Setup dependencies
  52. shell: bash
  53. run: |
  54. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh linux-${{ matrix.target }}
  55. apt-get install -yqq wget zip
  56. - name: Setup dependencies (aarch64)
  57. if: ${{ matrix.target == 'aarch64' }}
  58. shell: bash
  59. run: |
  60. apt-get install -yqq libsdl2-dev:arm64
  61. apt-get clean
  62. - name: Setup dependencies (armhf)
  63. if: ${{ matrix.target == 'armhf' }}
  64. shell: bash
  65. run: |
  66. apt-get install -yqq libsdl2-dev:armhf
  67. apt-get clean
  68. - name: Setup dependencies (i686)
  69. if: ${{ matrix.target == 'i686' }}
  70. shell: bash
  71. run: |
  72. apt-get install -yqq libsdl2-dev:i386
  73. apt-get clean
  74. - name: Setup dependencies (riscv64)
  75. if: ${{ matrix.target == 'riscv64' }}
  76. shell: bash
  77. run: |
  78. apt-get install -yqq libsdl2-dev:riscv64
  79. apt-get clean
  80. - name: Setup dependencies (x86_64)
  81. if: ${{ matrix.target == 'x86_64' }}
  82. shell: bash
  83. run: |
  84. apt-get install -yqq libsdl2-dev
  85. apt-get clean
  86. - name: Set up ccache
  87. uses: hendrikmuhs/ccache-action@v1.2
  88. with:
  89. key: ccache-linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  90. - name: Build extra dependencies
  91. run: |
  92. ./deps/PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh linux-${{ matrix.target }}
  93. - name: Build linux
  94. shell: bash
  95. run: |
  96. export PATH="/usr/lib/ccache:${PATH}"
  97. source deps/PawPaw/local.env linux-${{ matrix.target }}
  98. make features
  99. make HAVE_PULSEAUDIO=false NOOPT=true USING_GLES2=${{ matrix.target == 'aarch64' || matrix.target == 'armhf' }} -j $(nproc)
  100. make unzipfx
  101. - name: Set sha8 (non-release)
  102. if: startsWith(github.ref, 'refs/tags/') != true
  103. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  104. - name: Set sha8 (release)
  105. if: startsWith(github.ref, 'refs/tags/')
  106. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  107. - name: Pack binaries
  108. run: |
  109. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../CardinalJACK ../CardinalNative ../LICENSE ../README.md ../docs
  110. - uses: actions/upload-artifact@v4
  111. with:
  112. name: ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  113. path: |
  114. *.tar.gz
  115. - uses: softprops/action-gh-release@v1
  116. if: startsWith(github.ref, 'refs/tags/')
  117. with:
  118. tag_name: ${{ github.ref_name }}
  119. name: ${{ github.ref_name }}
  120. draft: false
  121. prerelease: false
  122. files: |
  123. *.tar.gz
  124. linux-x86_64-debug:
  125. runs-on: ubuntu-22.04
  126. steps:
  127. - uses: actions/checkout@v4
  128. with:
  129. submodules: recursive
  130. - name: Set up dependencies
  131. run: |
  132. sudo apt-get update -qq
  133. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf meson
  134. sudo apt-get clean
  135. - name: Build linux x86_64 (debug)
  136. env:
  137. LDFLAGS: -static-libgcc -static-libstdc++
  138. run: |
  139. make features
  140. # multiple jobs for building carla, deps and plugins
  141. make DEBUG=true carla deps dgl plugins resources -j $(nproc)
  142. # single job for final build stage, otherwise we might get killed due to OOM
  143. make DEBUG=true HAVE_PULSEAUDIO=false jack -j 1
  144. - name: Set sha8
  145. id: slug
  146. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  147. - name: Pack binaries
  148. run: |
  149. tar -c -h --hard-dereference -J -f ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}.tar.xz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../LICENSE ../README.md ../docs
  150. - uses: actions/upload-artifact@v4
  151. with:
  152. name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}
  153. path: |
  154. *.tar.xz
  155. macos:
  156. runs-on: macos-14
  157. steps:
  158. - uses: actions/checkout@v4
  159. with:
  160. submodules: recursive
  161. - name: Set up cache
  162. id: cache
  163. uses: actions/cache@v4
  164. with:
  165. path: |
  166. ~/PawPawBuilds
  167. src/Rack/dep/bin
  168. src/Rack/dep/include
  169. src/Rack/dep/lib
  170. src/Rack/dep/share
  171. src/Rack/dep/jansson-2.12
  172. src/Rack/dep/libarchive-3.4.3
  173. src/Rack/dep/libsamplerate-0.1.9
  174. src/Rack/dep/zstd-1.4.5
  175. key: macos-universal-v${{ env.CACHE_VERSION }}
  176. - name: Setup dependencies
  177. run: |
  178. brew uninstall --force --ignore-dependencies cmake
  179. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh macos-universal-10.15
  180. - name: Build extra dependencies
  181. run: |
  182. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  183. ./deps/PawPaw/bootstrap-cardinal.sh macos-universal-10.15 && ./deps/PawPaw/.cleanup.sh macos-universal-10.15
  184. - name: Set up ccache
  185. if: steps.cache.outputs.cache-hit == 'true'
  186. uses: hendrikmuhs/ccache-action@v1.2
  187. with:
  188. key: ccache-macos-universal-v${{ env.CACHE_VERSION }}
  189. - name: Build macOS (base)
  190. if: steps.cache.outputs.cache-hit == 'true'
  191. shell: bash
  192. run: |
  193. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  194. source deps/PawPaw/local.env macos-universal-10.15
  195. make features
  196. make NOOPT=true ${MAKE_ARGS} -j $(sysctl -n hw.logicalcpu)
  197. - name: Build macOS (packaging)
  198. if: steps.cache.outputs.cache-hit == 'true'
  199. shell: bash
  200. env:
  201. MACOS_APP_CERTIFICATE: ${{ secrets.MACOS_APP_CERTIFICATE }}
  202. MACOS_INSTALLER_CERTIFICATE: ${{ secrets.MACOS_INSTALLER_CERTIFICATE }}
  203. MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
  204. MACOS_NOTARIZATION_USER: ${{ secrets.MACOS_NOTARIZATION_USER }}
  205. MACOS_NOTARIZATION_PASS: ${{ secrets.MACOS_NOTARIZATION_PASS }}
  206. MACOS_NOTARIZATION_TEAM: ${{ secrets.MACOS_NOTARIZATION_TEAM }}
  207. run: |
  208. source deps/PawPaw/local.env macos-universal-10.15
  209. ./utils/create-macos-installer.sh
  210. - name: Set sha8 (non-release)
  211. if: startsWith(github.ref, 'refs/tags/') != true
  212. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  213. - name: Set sha8 (release)
  214. if: startsWith(github.ref, 'refs/tags/')
  215. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  216. - name: Rename macOS bundle
  217. if: steps.cache.outputs.cache-hit == 'true'
  218. run: |
  219. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  220. - uses: actions/upload-artifact@v4
  221. with:
  222. name: ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.SHA8 }}
  223. path: |
  224. ${{ github.event.repository.name }}-*.pkg
  225. - uses: softprops/action-gh-release@v1
  226. if: ${{ matrix.debug == '0' && startsWith(github.ref, 'refs/tags/') }}
  227. with:
  228. tag_name: ${{ github.ref_name }}
  229. name: ${{ github.ref_name }}
  230. draft: false
  231. prerelease: false
  232. files: |
  233. ${{ github.event.repository.name }}-*.pkg
  234. mod-plugin-builder:
  235. strategy:
  236. matrix:
  237. include:
  238. - name: darkglass-anagram
  239. target: darkglass-anagram
  240. - name: modduo
  241. target: modduo-static
  242. extraflags: MODDUO=true
  243. - name: modduox
  244. target: modduox-static
  245. - name: moddwarf
  246. target: moddwarf
  247. runs-on: ubuntu-22.04
  248. steps:
  249. - uses: actions/checkout@v4
  250. with:
  251. submodules: recursive
  252. - name: Set up cache
  253. uses: actions/cache@v4
  254. id: mpb-cache
  255. with:
  256. path: |
  257. ~/mod-workdir
  258. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  259. - name: Set up dependencies
  260. run: |
  261. sudo apt-get update -qq
  262. sudo apt-get install -yqq acl bc curl cvs git mercurial rsync subversion wget bison bzip2 flex gawk gperf gzip help2man nano perl patch tar texinfo unzip automake binutils build-essential cpio libtool libncurses-dev pkg-config python3 libtool-bin liblo-dev qemu-user-static
  263. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  264. sudo apt-get clean
  265. - name: Bootstrap toolchain
  266. if: steps.mpb-cache.outputs.cache-hit != 'true'
  267. run: |
  268. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  269. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  270. $(pwd)/deps/mod-plugin-builder/bootstrap.sh ${{ matrix.target }} minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh ${{ matrix.target }}
  271. - name: Build for modaudio
  272. if: steps.mpb-cache.outputs.cache-hit == 'true'
  273. run: |
  274. make HEADLESS=true ${{ matrix.name }}-features
  275. make HEADLESS=true ${{ matrix.extraflags }} ${{ matrix.name }} -j $(nproc)
  276. - name: Set sha8
  277. id: slug
  278. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  279. - name: Pack binaries
  280. if: steps.mpb-cache.outputs.cache-hit == 'true'
  281. run: |
  282. tar -c -h --hard-dereference -z -f ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep lv2)
  283. - uses: actions/upload-artifact@v4
  284. with:
  285. name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}
  286. path: |
  287. *.tar.gz
  288. wasm:
  289. strategy:
  290. matrix:
  291. target: [simd, nosimd]
  292. runs-on: ubuntu-22.04
  293. steps:
  294. - uses: actions/checkout@v4
  295. with:
  296. submodules: recursive
  297. - name: Set up cache
  298. id: cache
  299. uses: actions/cache@v4
  300. with:
  301. path: |
  302. ~/PawPawBuilds
  303. src/Rack/dep/bin
  304. src/Rack/dep/include
  305. src/Rack/dep/lib
  306. src/Rack/dep/share
  307. src/Rack/dep/jansson-2.12
  308. src/Rack/dep/libarchive-3.4.3
  309. src/Rack/dep/libsamplerate-0.1.9
  310. src/Rack/dep/zstd-1.4.5
  311. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  312. - name: Set up dependencies
  313. run: |
  314. sudo apt-get update -qq
  315. sudo apt-get install -yqq brotli gperf meson
  316. sudo apt-get clean
  317. - name: Build extra dependencies
  318. run: |
  319. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  320. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  321. - name: Build wasm cross-compiled
  322. if: steps.cache.outputs.cache-hit == 'true'
  323. shell: bash
  324. run: |
  325. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  326. source deps/PawPaw/local.env wasm
  327. # FIXME send patch upstream, assuming this works..
  328. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  329. make features
  330. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  331. - name: Build modgui
  332. if: steps.cache.outputs.cache-hit == 'true'
  333. shell: bash
  334. run: |
  335. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  336. source deps/PawPaw/local.env wasm
  337. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc) modgui
  338. - name: Make wasm versioned and compress
  339. if: steps.cache.outputs.cache-hit == 'true'
  340. shell: bash
  341. run: |
  342. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  343. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  344. cd bin
  345. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  346. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  347. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  348. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  349. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  350. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  351. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  352. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  353. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  354. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  355. brotli -k -q 11 *.data *.html *.js *.wasm
  356. - name: Set sha8 (non-release)
  357. if: startsWith(github.ref, 'refs/tags/') != true
  358. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  359. - name: Set sha8 (release)
  360. if: startsWith(github.ref, 'refs/tags/')
  361. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  362. - name: Pack binaries
  363. if: steps.cache.outputs.cache-hit == 'true'
  364. run: |
  365. cd bin; zip -r -9 ../${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls *.br *.html *.data *.js *.wasm) CardinalMini.lv2/modgui
  366. - uses: actions/upload-artifact@v4
  367. with:
  368. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  369. path: |
  370. *.zip
  371. - uses: softprops/action-gh-release@v1
  372. if: startsWith(github.ref, 'refs/tags/')
  373. with:
  374. tag_name: ${{ github.ref_name }}
  375. name: ${{ github.ref_name }}
  376. draft: false
  377. prerelease: false
  378. files: |
  379. *.zip
  380. windows:
  381. strategy:
  382. matrix:
  383. target: [win32, win64]
  384. runs-on: ubuntu-latest
  385. container:
  386. image: ubuntu:22.04
  387. steps:
  388. - name: Install git
  389. run: |
  390. apt-get update -qq && apt-get install -yqq --no-install-recommends ca-certificates git openssl
  391. - uses: actions/checkout@v4
  392. with:
  393. submodules: recursive
  394. - name: Set up cache
  395. id: cache
  396. uses: actions/cache@v4
  397. with:
  398. path: |
  399. ~/PawPawBuilds
  400. src/Rack/dep/bin
  401. src/Rack/dep/include
  402. src/Rack/dep/lib
  403. src/Rack/dep/share
  404. src/Rack/dep/jansson-2.12
  405. src/Rack/dep/libarchive-3.4.3
  406. src/Rack/dep/libsamplerate-0.1.9
  407. src/Rack/dep/zstd-1.4.5
  408. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  409. - name: Set up dependencies
  410. run: |
  411. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
  412. apt-get install -yqq wget xvfb zip
  413. apt-get clean
  414. - name: Set up ccache
  415. uses: hendrikmuhs/ccache-action@v1.2
  416. with:
  417. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  418. - name: Build extra dependencies
  419. run: |
  420. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  421. - name: Build cross-compiled (base)
  422. if: steps.cache.outputs.cache-hit == 'true'
  423. shell: bash
  424. run: |
  425. export PATH="/usr/lib/ccache:${PATH}"
  426. source deps/PawPaw/local.env ${{ matrix.target }}
  427. make features
  428. xvfb-run make NOOPT=true -j $(nproc)
  429. - name: Build cross-compiled (carla)
  430. if: steps.cache.outputs.cache-hit == 'true'
  431. shell: bash
  432. run: |
  433. export PATH="/usr/lib/ccache:${PATH}"
  434. source deps/PawPaw/local.env ${{ matrix.target }}
  435. make carla-win32 -j $(nproc)
  436. make -C carla EMBED_TARGET=true TESTING=true dist
  437. make -C carla EMBED_TARGET=true TESTING=true dist
  438. - name: Build cross-compiled (packaging)
  439. if: steps.cache.outputs.cache-hit == 'true'
  440. shell: bash
  441. run: |
  442. source deps/PawPaw/local.env ${{ matrix.target }}
  443. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  444. make unzipfx
  445. - name: Set sha8 (non-release)
  446. if: startsWith(github.ref, 'refs/tags/') != true
  447. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  448. - name: Set sha8 (release)
  449. if: startsWith(github.ref, 'refs/tags/')
  450. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  451. - name: Pack binaries
  452. if: steps.cache.outputs.cache-hit == 'true'
  453. shell: bash
  454. run: |
  455. pushd bin
  456. zip -r -9 ../${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip $(ls | grep -e lv2 -e vst -e clap)
  457. popd
  458. zip -u -9 ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.zip LICENSE README.md docs/*.* CardinalJACK.exe CardinalNative.exe
  459. - uses: actions/upload-artifact@v4
  460. with:
  461. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  462. path: |
  463. Cardinal-*.exe
  464. Cardinal-*.zip
  465. - uses: softprops/action-gh-release@v1
  466. if: startsWith(github.ref, 'refs/tags/')
  467. with:
  468. tag_name: ${{ github.ref_name }}
  469. name: ${{ github.ref_name }}
  470. draft: false
  471. prerelease: false
  472. files: |
  473. Cardinal-*.exe
  474. Cardinal-*.zip
  475. headless:
  476. runs-on: ubuntu-22.04
  477. steps:
  478. - uses: actions/checkout@v4
  479. with:
  480. submodules: recursive
  481. - name: Set up dependencies
  482. run: |
  483. sudo apt-get update -qq
  484. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  485. sudo apt-get install -yqq liblo-dev
  486. sudo apt-get clean
  487. - name: Build linux (headless)
  488. run: |
  489. make HEADLESS=true features
  490. make HEADLESS=true -j $(nproc)
  491. lto:
  492. runs-on: ubuntu-22.04
  493. steps:
  494. - uses: actions/checkout@v4
  495. with:
  496. submodules: recursive
  497. - name: Set up dependencies
  498. run: |
  499. sudo apt-get update -qq
  500. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev liblo-dev libsdl2-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  501. sudo apt-get clean
  502. - name: Build linux (LTO)
  503. run: |
  504. make features
  505. make WITH_LTO=true -j $(nproc) mini
  506. make WITH_LTO=true -j $(nproc) native
  507. sysdeps:
  508. runs-on: ubuntu-22.04
  509. steps:
  510. - uses: actions/checkout@v4
  511. with:
  512. submodules: recursive
  513. - name: Set up dependencies
  514. run: |
  515. sudo apt-get update -qq
  516. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev libarchive-dev libfftw3-dev libjansson-dev libsamplerate0-dev libsndfile1-dev libspeexdsp-dev
  517. sudo apt-get clean
  518. - name: Build linux (sysdeps)
  519. run: |
  520. make features
  521. make SYSDEPS=true -j $(nproc)
  522. source-tarball:
  523. runs-on: ubuntu-22.04
  524. steps:
  525. - uses: actions/checkout@v4
  526. with:
  527. submodules: recursive
  528. - name: Set up dependencies
  529. run: |
  530. sudo apt-get update -qq
  531. sudo apt-get install -yqq liblo-dev
  532. sudo apt-get clean
  533. - name: Create source tarball
  534. run: |
  535. make HEADLESS=true tarball
  536. make HEADLESS=true tarball+deps
  537. - name: Set sha8 (non-release)
  538. if: startsWith(github.ref, 'refs/tags/') != true
  539. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  540. - name: Set sha8 (release)
  541. if: startsWith(github.ref, 'refs/tags/')
  542. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  543. - uses: actions/upload-artifact@v4
  544. with:
  545. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  546. path: |
  547. /home/runner/cardinal*.tar.xz
  548. /home/runner/*/cardinal*.tar.xz
  549. /home/runner/*/*/cardinal*.tar.xz
  550. - uses: softprops/action-gh-release@v1
  551. if: startsWith(github.ref, 'refs/tags/')
  552. with:
  553. tag_name: ${{ github.ref_name }}
  554. name: ${{ github.ref_name }}
  555. draft: false
  556. prerelease: false
  557. files: |
  558. /home/runner/cardinal*.tar.xz
  559. /home/runner/*/cardinal*.tar.xz
  560. /home/runner/*/*/cardinal*.tar.xz
  561. plugin-validation:
  562. runs-on: ubuntu-22.04
  563. steps:
  564. - uses: actions/checkout@v4
  565. with:
  566. submodules: recursive
  567. - name: Set up cache
  568. id: cache
  569. uses: actions/cache@v4
  570. with:
  571. path: |
  572. src/Rack/dep/bin
  573. src/Rack/dep/include
  574. src/Rack/dep/lib
  575. src/Rack/dep/share
  576. src/Rack/dep/jansson-2.12
  577. src/Rack/dep/libarchive-3.4.3
  578. src/Rack/dep/libsamplerate-0.1.9
  579. src/Rack/dep/zstd-1.4.5
  580. key: pluginval-v${{ env.CACHE_VERSION }}
  581. - name: Set up dependencies
  582. run: |
  583. # custom repos
  584. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.2.0_all.deb
  585. sudo dpkg -i kxstudio-repos_11.2.0_all.deb
  586. sudo apt-get update -qq
  587. # build-deps
  588. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  589. # runtime testing
  590. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  591. sudo apt-get clean
  592. # multiple jobs for building carla, deps and plugins
  593. - name: Build Cardinal (carla, deps and plugins)
  594. env:
  595. CFLAGS: -g
  596. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  597. LDFLAGS: -static-libgcc -static-libstdc++
  598. run: |
  599. make features
  600. make CIBUILD=false NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  601. # single job for final build stage, otherwise we might get killed due to OOM
  602. - name: Build Cardinal (final build stage)
  603. env:
  604. CFLAGS: -g
  605. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  606. LDFLAGS: -static-libgcc -static-libstdc++
  607. run: |
  608. make features
  609. make CIBUILD=false NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  610. make CIBUILD=false NOOPT=true -j 1
  611. ./dpf/utils/generate-ttl.sh
  612. - name: Run Cardinal self-tests
  613. run: |
  614. # --exit-on-first-error=yes
  615. xvfb-run valgrind \
  616. --gen-suppressions=all \
  617. --error-exitcode=255 \
  618. --leak-check=no \
  619. --track-origins=yes \
  620. --keep-debuginfo=yes \
  621. --suppressions=./dpf/utils/valgrind-dpf.supp \
  622. ./bin/Cardinal selftest
  623. - name: Validate LV2 ttl syntax
  624. run: |
  625. lv2_validate \
  626. /usr/lib/lv2/kx-meta/*.ttl \
  627. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  628. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  629. /usr/lib/lv2/mod.lv2/*.ttl \
  630. /usr/lib/lv2/modgui.lv2/*.ttl \
  631. ./bin/*.lv2/*.ttl
  632. - name: Validate LV2 metadata and binaries
  633. run: |
  634. export LV2_PATH=/tmp/lv2-path
  635. mkdir ${LV2_PATH}
  636. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  637. cp -r /usr/lib/lv2/{atom,buf-size,core,data-access,kx-control-input-port-change-request,kx-programs,instance-access,midi,mod,modgui,parameters,port-groups,port-props,options,patch,presets,resize-port,state,time,ui,units,urid,worker}.lv2 ${LV2_PATH}
  638. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  639. - name: Test LV2 plugin
  640. run: |
  641. export LV2_PATH=/tmp/lv2-path
  642. for p in $(lv2ls); do \
  643. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  644. xvfb-run valgrind \
  645. --error-exitcode=255 \
  646. --leak-check=no \
  647. --track-origins=yes \
  648. --keep-debuginfo=yes \
  649. --suppressions=./dpf/utils/valgrind-dpf.supp \
  650. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  651. done
  652. - name: Test VST2 plugin
  653. run: |
  654. for p in $(ls bin/*.vst/*.so); do \
  655. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  656. xvfb-run valgrind \
  657. --error-exitcode=255 \
  658. --leak-check=no \
  659. --track-origins=yes \
  660. --keep-debuginfo=yes \
  661. --suppressions=./dpf/utils/valgrind-dpf.supp \
  662. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  663. done
  664. - name: Test VST3 plugin
  665. run: |
  666. for p in $(ls bin/ | grep vst3); do \
  667. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  668. xvfb-run valgrind \
  669. --error-exitcode=255 \
  670. --leak-check=no \
  671. --track-origins=yes \
  672. --keep-debuginfo=yes \
  673. --suppressions=./dpf/utils/valgrind-dpf.supp \
  674. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  675. done