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.

680 lines
27KB

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