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.

682 lines
27KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 12
  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. run: |
  201. source deps/PawPaw/local.env macos-universal-10.15
  202. ./utils/create-macos-installer.sh
  203. - name: Set sha8 (non-release)
  204. if: startsWith(github.ref, 'refs/tags/') != true
  205. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  206. - name: Set sha8 (release)
  207. if: startsWith(github.ref, 'refs/tags/')
  208. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  209. - name: Rename macOS bundle
  210. if: steps.cache.outputs.cache-hit == 'true'
  211. run: |
  212. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  213. - uses: actions/upload-artifact@v4
  214. with:
  215. name: ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.SHA8 }}
  216. path: |
  217. ${{ github.event.repository.name }}-*.pkg
  218. - uses: softprops/action-gh-release@v1
  219. if: ${{ matrix.debug == '0' && startsWith(github.ref, 'refs/tags/') }}
  220. with:
  221. tag_name: ${{ github.ref_name }}
  222. name: ${{ github.ref_name }}
  223. draft: false
  224. prerelease: false
  225. files: |
  226. ${{ github.event.repository.name }}-*.pkg
  227. mod-plugin-builder:
  228. strategy:
  229. matrix:
  230. include:
  231. - name: darkglass-anagram
  232. target: darkglass-anagram
  233. - name: modduo
  234. target: modduo-static
  235. extraflags: MODDUO=true
  236. - name: modduox
  237. target: modduox-static
  238. - name: moddwarf
  239. target: moddwarf
  240. runs-on: ubuntu-22.04
  241. steps:
  242. - uses: actions/checkout@v4
  243. with:
  244. submodules: recursive
  245. - name: Set up cache
  246. uses: actions/cache@v4
  247. id: mpb-cache
  248. with:
  249. path: |
  250. ~/mod-workdir
  251. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  252. - name: Set up dependencies
  253. run: |
  254. sudo apt-get update -qq
  255. 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
  256. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  257. sudo apt-get clean
  258. - name: Bootstrap toolchain
  259. if: steps.mpb-cache.outputs.cache-hit != 'true'
  260. run: |
  261. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  262. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  263. $(pwd)/deps/mod-plugin-builder/bootstrap.sh ${{ matrix.target }} minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh ${{ matrix.target }}
  264. - name: Build for modaudio
  265. if: steps.mpb-cache.outputs.cache-hit == 'true'
  266. run: |
  267. make HEADLESS=true ${{ matrix.name }}-features
  268. make HEADLESS=true ${{ matrix.extraflags }} ${{ matrix.name }} -j $(nproc)
  269. - name: Set sha8
  270. id: slug
  271. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  272. - name: Pack binaries
  273. if: steps.mpb-cache.outputs.cache-hit == 'true'
  274. run: |
  275. 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)
  276. - uses: actions/upload-artifact@v4
  277. with:
  278. name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}
  279. path: |
  280. *.tar.gz
  281. wasm:
  282. strategy:
  283. matrix:
  284. target: [simd, nosimd]
  285. runs-on: ubuntu-22.04
  286. steps:
  287. - uses: actions/checkout@v4
  288. with:
  289. submodules: recursive
  290. - name: Set up cache
  291. id: cache
  292. uses: actions/cache@v4
  293. with:
  294. path: |
  295. ~/PawPawBuilds
  296. src/Rack/dep/bin
  297. src/Rack/dep/include
  298. src/Rack/dep/lib
  299. src/Rack/dep/share
  300. src/Rack/dep/jansson-2.12
  301. src/Rack/dep/libarchive-3.4.3
  302. src/Rack/dep/libsamplerate-0.1.9
  303. src/Rack/dep/zstd-1.4.5
  304. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  305. - name: Set up dependencies
  306. run: |
  307. sudo apt-get update -qq
  308. sudo apt-get install -yqq brotli gperf meson
  309. sudo apt-get clean
  310. - name: Build extra dependencies
  311. run: |
  312. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  313. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  314. - name: Build wasm cross-compiled
  315. if: steps.cache.outputs.cache-hit == 'true'
  316. shell: bash
  317. run: |
  318. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  319. source deps/PawPaw/local.env wasm
  320. # FIXME send patch upstream, assuming this works..
  321. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  322. make features
  323. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  324. - name: Build modgui
  325. if: steps.cache.outputs.cache-hit == 'true'
  326. shell: bash
  327. run: |
  328. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  329. source deps/PawPaw/local.env wasm
  330. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc) modgui
  331. - name: Make wasm versioned and compress
  332. if: steps.cache.outputs.cache-hit == 'true'
  333. shell: bash
  334. run: |
  335. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  336. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  337. cd bin
  338. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  339. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  340. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  341. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  342. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  343. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  344. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  345. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  346. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  347. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  348. brotli -k -q 11 *.data *.html *.js *.wasm
  349. - name: Set sha8 (non-release)
  350. if: startsWith(github.ref, 'refs/tags/') != true
  351. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  352. - name: Set sha8 (release)
  353. if: startsWith(github.ref, 'refs/tags/')
  354. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  355. - name: Pack binaries
  356. if: steps.cache.outputs.cache-hit == 'true'
  357. run: |
  358. 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
  359. - uses: actions/upload-artifact@v4
  360. with:
  361. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  362. path: |
  363. *.zip
  364. - uses: softprops/action-gh-release@v1
  365. if: startsWith(github.ref, 'refs/tags/')
  366. with:
  367. tag_name: ${{ github.ref_name }}
  368. name: ${{ github.ref_name }}
  369. draft: false
  370. prerelease: false
  371. files: |
  372. *.zip
  373. windows:
  374. strategy:
  375. matrix:
  376. target: [win32, win64]
  377. runs-on: ubuntu-latest
  378. container:
  379. image: ubuntu:22.04
  380. steps:
  381. - name: Install git
  382. run: |
  383. apt-get update -qq && apt-get install -yqq --no-install-recommends ca-certificates git openssl
  384. - uses: actions/checkout@v4
  385. with:
  386. submodules: recursive
  387. - name: Set up cache
  388. id: cache
  389. uses: actions/cache@v4
  390. with:
  391. path: |
  392. ~/PawPawBuilds
  393. src/Rack/dep/bin
  394. src/Rack/dep/include
  395. src/Rack/dep/lib
  396. src/Rack/dep/share
  397. src/Rack/dep/jansson-2.12
  398. src/Rack/dep/libarchive-3.4.3
  399. src/Rack/dep/libsamplerate-0.1.9
  400. src/Rack/dep/zstd-1.4.5
  401. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  402. - name: Set up dependencies
  403. run: |
  404. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
  405. apt-get install -yqq wget xvfb zip
  406. apt-get clean
  407. - name: Set up ccache
  408. uses: hendrikmuhs/ccache-action@v1.2
  409. with:
  410. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  411. - name: Build extra dependencies
  412. run: |
  413. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  414. - name: Build cross-compiled (base)
  415. if: steps.cache.outputs.cache-hit == 'true'
  416. shell: bash
  417. run: |
  418. export PATH="/usr/lib/ccache:${PATH}"
  419. source deps/PawPaw/local.env ${{ matrix.target }}
  420. make features
  421. xvfb-run make NOOPT=true -j $(nproc)
  422. - name: Build cross-compiled (carla)
  423. if: steps.cache.outputs.cache-hit == 'true'
  424. shell: bash
  425. run: |
  426. export PATH="/usr/lib/ccache:${PATH}"
  427. source deps/PawPaw/local.env ${{ matrix.target }}
  428. make carla-win32 -j $(nproc)
  429. make -C carla EMBED_TARGET=true TESTING=true dist
  430. make -C carla EMBED_TARGET=true TESTING=true dist
  431. - name: Build cross-compiled (packaging)
  432. if: steps.cache.outputs.cache-hit == 'true'
  433. shell: bash
  434. run: |
  435. source deps/PawPaw/local.env ${{ matrix.target }}
  436. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  437. make unzipfx
  438. - name: Set sha8 (non-release)
  439. if: startsWith(github.ref, 'refs/tags/') != true
  440. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  441. - name: Set sha8 (release)
  442. if: startsWith(github.ref, 'refs/tags/')
  443. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  444. - name: Pack binaries
  445. if: steps.cache.outputs.cache-hit == 'true'
  446. shell: bash
  447. run: |
  448. pushd bin
  449. 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)
  450. popd
  451. 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
  452. - uses: actions/upload-artifact@v4
  453. with:
  454. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  455. path: |
  456. Cardinal-*.exe
  457. Cardinal-*.zip
  458. - uses: softprops/action-gh-release@v1
  459. if: startsWith(github.ref, 'refs/tags/')
  460. with:
  461. tag_name: ${{ github.ref_name }}
  462. name: ${{ github.ref_name }}
  463. draft: false
  464. prerelease: false
  465. files: |
  466. Cardinal-*.exe
  467. Cardinal-*.zip
  468. headless:
  469. runs-on: ubuntu-22.04
  470. steps:
  471. - uses: actions/checkout@v4
  472. with:
  473. submodules: recursive
  474. - name: Set up dependencies
  475. run: |
  476. sudo apt-get update -qq
  477. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  478. sudo apt-get install -yqq liblo-dev
  479. sudo apt-get clean
  480. - name: Build linux (headless)
  481. run: |
  482. make HEADLESS=true features
  483. make HEADLESS=true -j $(nproc)
  484. lto:
  485. runs-on: ubuntu-22.04
  486. steps:
  487. - uses: actions/checkout@v4
  488. with:
  489. submodules: recursive
  490. - name: Set up dependencies
  491. run: |
  492. sudo apt-get update -qq
  493. 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
  494. sudo apt-get clean
  495. - name: Build linux (LTO)
  496. run: |
  497. make features
  498. make WITH_LTO=true -j $(nproc) mini
  499. make WITH_LTO=true -j $(nproc) native
  500. sysdeps:
  501. runs-on: ubuntu-22.04
  502. steps:
  503. - uses: actions/checkout@v4
  504. with:
  505. submodules: recursive
  506. - name: Set up dependencies
  507. run: |
  508. sudo apt-get update -qq
  509. 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
  510. sudo apt-get clean
  511. - name: Build linux (sysdeps)
  512. run: |
  513. make features
  514. make SYSDEPS=true -j $(nproc)
  515. source-tarball:
  516. runs-on: ubuntu-22.04
  517. steps:
  518. - uses: actions/checkout@v4
  519. with:
  520. submodules: recursive
  521. - name: Set up dependencies
  522. run: |
  523. sudo apt-get update -qq
  524. sudo apt-get install -yqq liblo-dev
  525. sudo apt-get clean
  526. - name: Create source tarball
  527. run: |
  528. make HEADLESS=true tarball
  529. make HEADLESS=true tarball+deps
  530. - name: Set sha8 (non-release)
  531. if: startsWith(github.ref, 'refs/tags/') != true
  532. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  533. - name: Set sha8 (release)
  534. if: startsWith(github.ref, 'refs/tags/')
  535. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  536. - uses: actions/upload-artifact@v4
  537. with:
  538. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  539. path: |
  540. /home/runner/cardinal*.tar.xz
  541. /home/runner/*/cardinal*.tar.xz
  542. /home/runner/*/*/cardinal*.tar.xz
  543. - uses: softprops/action-gh-release@v1
  544. if: startsWith(github.ref, 'refs/tags/')
  545. with:
  546. tag_name: ${{ github.ref_name }}
  547. name: ${{ github.ref_name }}
  548. draft: false
  549. prerelease: false
  550. files: |
  551. /home/runner/cardinal*.tar.xz
  552. /home/runner/*/cardinal*.tar.xz
  553. /home/runner/*/*/cardinal*.tar.xz
  554. plugin-validation:
  555. runs-on: ubuntu-22.04
  556. steps:
  557. - uses: actions/checkout@v4
  558. with:
  559. submodules: recursive
  560. - name: Set up cache
  561. id: cache
  562. uses: actions/cache@v4
  563. with:
  564. path: |
  565. src/Rack/dep/bin
  566. src/Rack/dep/include
  567. src/Rack/dep/lib
  568. src/Rack/dep/share
  569. src/Rack/dep/jansson-2.12
  570. src/Rack/dep/libarchive-3.4.3
  571. src/Rack/dep/libsamplerate-0.1.9
  572. src/Rack/dep/zstd-1.4.5
  573. key: pluginval-v${{ env.CACHE_VERSION }}
  574. - name: Set up dependencies
  575. run: |
  576. # custom repos
  577. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.2.0_all.deb
  578. sudo dpkg -i kxstudio-repos_11.2.0_all.deb
  579. sudo apt-get update -qq
  580. # build-deps
  581. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  582. # runtime testing
  583. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  584. sudo apt-get clean
  585. # multiple jobs for building carla, deps and plugins
  586. - name: Build Cardinal (carla, deps and plugins)
  587. env:
  588. CFLAGS: -g
  589. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  590. LDFLAGS: -static-libgcc -static-libstdc++
  591. run: |
  592. make features
  593. make CIBUILD=false NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  594. # single job for final build stage, otherwise we might get killed due to OOM
  595. - name: Build Cardinal (final build stage)
  596. env:
  597. CFLAGS: -g
  598. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  599. LDFLAGS: -static-libgcc -static-libstdc++
  600. run: |
  601. make features
  602. make CIBUILD=false NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  603. make CIBUILD=false NOOPT=true -j 1
  604. ./dpf/utils/generate-ttl.sh
  605. - name: Run Cardinal self-tests
  606. run: |
  607. # --exit-on-first-error=yes
  608. xvfb-run valgrind \
  609. --gen-suppressions=all \
  610. --error-exitcode=255 \
  611. --leak-check=no \
  612. --track-origins=yes \
  613. --keep-debuginfo=yes \
  614. --suppressions=./dpf/utils/valgrind-dpf.supp \
  615. ./bin/Cardinal selftest
  616. - name: Validate LV2 ttl syntax
  617. run: |
  618. lv2_validate \
  619. /usr/lib/lv2/kx-meta/*.ttl \
  620. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  621. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  622. /usr/lib/lv2/mod.lv2/*.ttl \
  623. /usr/lib/lv2/modgui.lv2/*.ttl \
  624. ./bin/*.lv2/*.ttl
  625. - name: Validate LV2 metadata and binaries
  626. run: |
  627. export LV2_PATH=/tmp/lv2-path
  628. mkdir ${LV2_PATH}
  629. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  630. 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}
  631. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  632. - name: Test LV2 plugin
  633. run: |
  634. export LV2_PATH=/tmp/lv2-path
  635. for p in $(lv2ls); do \
  636. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  637. xvfb-run valgrind \
  638. --error-exitcode=255 \
  639. --leak-check=no \
  640. --track-origins=yes \
  641. --keep-debuginfo=yes \
  642. --suppressions=./dpf/utils/valgrind-dpf.supp \
  643. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  644. done
  645. - name: Test VST2 plugin
  646. run: |
  647. for p in $(ls bin/*.vst/*.so); do \
  648. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  649. xvfb-run valgrind \
  650. --error-exitcode=255 \
  651. --leak-check=no \
  652. --track-origins=yes \
  653. --keep-debuginfo=yes \
  654. --suppressions=./dpf/utils/valgrind-dpf.supp \
  655. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  656. done
  657. - name: Test VST3 plugin
  658. run: |
  659. for p in $(ls bin/ | grep vst3); do \
  660. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  661. xvfb-run valgrind \
  662. --error-exitcode=255 \
  663. --leak-check=no \
  664. --track-origins=yes \
  665. --keep-debuginfo=yes \
  666. --suppressions=./dpf/utils/valgrind-dpf.supp \
  667. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  668. done