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: 9
  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:20.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-20.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 clap lv2 vst2 vst3 -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. strategy:
  156. matrix:
  157. target: [universal-10.15]
  158. runs-on: macos-11
  159. steps:
  160. - uses: actions/checkout@v4
  161. with:
  162. submodules: recursive
  163. - name: Set up cache
  164. id: cache
  165. uses: actions/cache@v4
  166. with:
  167. path: |
  168. ~/PawPawBuilds
  169. src/Rack/dep/bin
  170. src/Rack/dep/include
  171. src/Rack/dep/lib
  172. src/Rack/dep/share
  173. src/Rack/dep/jansson-2.12
  174. src/Rack/dep/libarchive-3.4.3
  175. src/Rack/dep/libsamplerate-0.1.9
  176. src/Rack/dep/zstd-1.4.5
  177. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  178. - name: Setup dependencies
  179. run: |
  180. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh macos-${{ matrix.target }}
  181. - name: Build extra dependencies
  182. run: |
  183. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  184. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  185. - name: Set up ccache
  186. if: steps.cache.outputs.cache-hit == 'true'
  187. uses: hendrikmuhs/ccache-action@v1.2
  188. with:
  189. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  190. - name: Build macOS (base)
  191. if: steps.cache.outputs.cache-hit == 'true'
  192. shell: bash
  193. run: |
  194. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  195. source deps/PawPaw/local.env macos-${{ matrix.target }}
  196. make features
  197. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  198. - name: Build macOS (packaging)
  199. if: steps.cache.outputs.cache-hit == 'true'
  200. shell: bash
  201. run: |
  202. source deps/PawPaw/local.env macos-${{ matrix.target }}
  203. ./utils/create-macos-installer.sh
  204. - name: Set sha8 (non-release)
  205. if: startsWith(github.ref, 'refs/tags/') != true
  206. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  207. - name: Set sha8 (release)
  208. if: startsWith(github.ref, 'refs/tags/')
  209. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  210. - name: Rename macOS bundle
  211. if: steps.cache.outputs.cache-hit == 'true'
  212. run: |
  213. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  214. - uses: actions/upload-artifact@v4
  215. with:
  216. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  217. path: |
  218. ${{ github.event.repository.name }}-*.pkg
  219. - uses: softprops/action-gh-release@v1
  220. if: startsWith(github.ref, 'refs/tags/')
  221. with:
  222. tag_name: ${{ github.ref_name }}
  223. name: ${{ github.ref_name }}
  224. draft: false
  225. prerelease: false
  226. files: |
  227. ${{ github.event.repository.name }}-*.pkg
  228. modaudio:
  229. strategy:
  230. matrix:
  231. include:
  232. - name: modduo
  233. target: modduo-static
  234. extraflags: MODDUO=true
  235. - name: modduox
  236. target: modduox-static
  237. - name: moddwarf
  238. target: moddwarf
  239. runs-on: ubuntu-20.04
  240. steps:
  241. - uses: actions/checkout@v4
  242. with:
  243. submodules: recursive
  244. - name: Set up cache
  245. uses: actions/cache@v4
  246. id: mpb-cache
  247. with:
  248. path: |
  249. ~/mod-workdir
  250. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  251. - name: Set up dependencies
  252. run: |
  253. sudo apt-get update -qq
  254. 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 python libtool-bin liblo-dev qemu-user-static
  255. sudo apt-get install -yqq pandoc texlive-latex-recommended texlive-latex-extra
  256. sudo apt-get clean
  257. - name: Bootstrap toolchain
  258. if: steps.mpb-cache.outputs.cache-hit != 'true'
  259. run: |
  260. git clone --depth=1 https://github.com/moddevices/mod-plugin-builder.git deps/mod-plugin-builder
  261. sed -i "s/CT_LOG_PROGRESS_BAR=y/CT_LOG_PROGRESS_BAR=n/" deps/mod-plugin-builder/toolchain/*.config
  262. $(pwd)/deps/mod-plugin-builder/bootstrap.sh ${{ matrix.target }} minimal && $(pwd)/deps/mod-plugin-builder/.clean-install.sh ${{ matrix.target }}
  263. - name: Build for modaudio
  264. if: steps.mpb-cache.outputs.cache-hit == 'true'
  265. run: |
  266. make HEADLESS=true ${{ matrix.name }}-features
  267. make HEADLESS=true ${{ matrix.extraflags }} ${{ matrix.name }} -j $(nproc)
  268. - name: Set sha8
  269. id: slug
  270. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  271. - name: Pack binaries
  272. if: steps.mpb-cache.outputs.cache-hit == 'true'
  273. run: |
  274. 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)
  275. - uses: actions/upload-artifact@v4
  276. with:
  277. name: ${{ github.event.repository.name }}-${{ matrix.name }}-${{ github.event.pull_request.number || env.SHA8 }}
  278. path: |
  279. *.tar.gz
  280. wasm:
  281. strategy:
  282. matrix:
  283. target: [simd, nosimd]
  284. runs-on: ubuntu-22.04
  285. steps:
  286. - uses: actions/checkout@v4
  287. with:
  288. submodules: recursive
  289. - name: Set up cache
  290. id: cache
  291. uses: actions/cache@v4
  292. with:
  293. path: |
  294. ~/PawPawBuilds
  295. src/Rack/dep/bin
  296. src/Rack/dep/include
  297. src/Rack/dep/lib
  298. src/Rack/dep/share
  299. src/Rack/dep/jansson-2.12
  300. src/Rack/dep/libarchive-3.4.3
  301. src/Rack/dep/libsamplerate-0.1.9
  302. src/Rack/dep/zstd-1.4.5
  303. key: wasm-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  304. - name: Set up dependencies
  305. run: |
  306. sudo apt-get update -qq
  307. sudo apt-get install -yqq brotli gperf meson
  308. sudo apt-get clean
  309. - name: Build extra dependencies
  310. run: |
  311. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  312. ./deps/PawPaw/bootstrap-cardinal.sh wasm && ./deps/PawPaw/.cleanup.sh wasm
  313. - name: Build wasm cross-compiled
  314. if: steps.cache.outputs.cache-hit == 'true'
  315. shell: bash
  316. run: |
  317. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  318. source deps/PawPaw/local.env wasm
  319. # FIXME send patch upstream, assuming this works..
  320. sed -i -e 's/defined(__riscv)/defined(__riscv) || defined(__EMSCRIPTEN__)/' plugins/surgext/surge/src/common/globals.h
  321. make features
  322. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc)
  323. - name: Build modgui
  324. if: steps.cache.outputs.cache-hit == 'true'
  325. shell: bash
  326. run: |
  327. ${{ matrix.target == 'nosimd' }} && export PAWPAW_NOSIMD=1
  328. source deps/PawPaw/local.env wasm
  329. make HAVE_LIBLO=false NOOPT=true NOSIMD=${{ matrix.target == 'nosimd' }} -j $(nproc) -C src/CardinalMiniSep modgui
  330. - name: Make wasm versioned and compress
  331. if: steps.cache.outputs.cache-hit == 'true'
  332. shell: bash
  333. run: |
  334. ${{ matrix.target == 'nosimd' }} && export SUFFIX="-nosimd"
  335. VERSION=$(cat Makefile | awk 'sub("VERSION = ","")')
  336. cd bin
  337. sed -i "s/CardinalMini\./CardinalMini-v${VERSION}\./g" *.html *.js
  338. sed -i "s/CardinalNative\./CardinalNative-v${VERSION}\./g" *.html *.js
  339. sed -i "s/CardinalMini-nosimd\./CardinalMini-nosimd-v${VERSION}\./g" *.html *.js
  340. sed -i "s/CardinalNative-nosimd\./CardinalNative-nosimd-v${VERSION}\./g" *.html *.js
  341. mv CardinalMini.data CardinalMini${SUFFIX}-v${VERSION}.data
  342. mv CardinalMini.js CardinalMini${SUFFIX}-v${VERSION}.js
  343. mv CardinalMini.wasm CardinalMini${SUFFIX}-v${VERSION}.wasm
  344. mv CardinalNative.data CardinalNative${SUFFIX}-v${VERSION}.data
  345. mv CardinalNative.js CardinalNative${SUFFIX}-v${VERSION}.js
  346. mv CardinalNative.wasm CardinalNative${SUFFIX}-v${VERSION}.wasm
  347. brotli -k -q 11 *.data *.html *.js *.wasm
  348. - name: Set sha8 (non-release)
  349. if: startsWith(github.ref, 'refs/tags/') != true
  350. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  351. - name: Set sha8 (release)
  352. if: startsWith(github.ref, 'refs/tags/')
  353. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  354. - name: Pack binaries
  355. if: steps.cache.outputs.cache-hit == 'true'
  356. run: |
  357. 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
  358. - uses: actions/upload-artifact@v4
  359. with:
  360. name: ${{ github.event.repository.name }}-wasm-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  361. path: |
  362. *.zip
  363. - uses: softprops/action-gh-release@v1
  364. if: startsWith(github.ref, 'refs/tags/')
  365. with:
  366. tag_name: ${{ github.ref_name }}
  367. name: ${{ github.ref_name }}
  368. draft: false
  369. prerelease: false
  370. files: |
  371. *.zip
  372. windows:
  373. strategy:
  374. matrix:
  375. target: [win32, win64]
  376. runs-on: ubuntu-latest
  377. container:
  378. image: ubuntu:22.04
  379. steps:
  380. - name: Install git
  381. run: |
  382. apt-get update -qq && apt-get install -yqq --no-install-recommends ca-certificates git openssl
  383. - uses: actions/checkout@v4
  384. with:
  385. submodules: recursive
  386. - name: Set up cache
  387. id: cache
  388. uses: actions/cache@v4
  389. with:
  390. path: |
  391. ~/PawPawBuilds
  392. src/Rack/dep/bin
  393. src/Rack/dep/include
  394. src/Rack/dep/lib
  395. src/Rack/dep/share
  396. src/Rack/dep/jansson-2.12
  397. src/Rack/dep/libarchive-3.4.3
  398. src/Rack/dep/libsamplerate-0.1.9
  399. src/Rack/dep/zstd-1.4.5
  400. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  401. - name: Set up dependencies
  402. run: |
  403. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
  404. apt-get install -yqq wget xvfb zip
  405. apt-get clean
  406. - name: Set up ccache
  407. uses: hendrikmuhs/ccache-action@v1.2
  408. with:
  409. key: ccache-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  410. - name: Build extra dependencies
  411. run: |
  412. ./deps/PawPaw/bootstrap-cardinal.sh ${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh ${{ matrix.target }}
  413. - name: Build cross-compiled (base)
  414. if: steps.cache.outputs.cache-hit == 'true'
  415. shell: bash
  416. run: |
  417. export PATH="/usr/lib/ccache:${PATH}"
  418. source deps/PawPaw/local.env ${{ matrix.target }}
  419. make features
  420. make NOOPT=true -j $(nproc)
  421. - name: Build cross-compiled (carla)
  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 carla-win32 -j $(nproc)
  428. make -C carla EMBED_TARGET=true TESTING=true dist
  429. make -C carla EMBED_TARGET=true TESTING=true dist
  430. - name: Build cross-compiled (packaging)
  431. if: steps.cache.outputs.cache-hit == 'true'
  432. shell: bash
  433. run: |
  434. source deps/PawPaw/local.env ${{ matrix.target }}
  435. xvfb-run ./utils/create-windows-installer.sh ${{ matrix.target }}
  436. make unzipfx
  437. - name: Set sha8 (non-release)
  438. if: startsWith(github.ref, 'refs/tags/') != true
  439. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  440. - name: Set sha8 (release)
  441. if: startsWith(github.ref, 'refs/tags/')
  442. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  443. - name: Pack binaries
  444. if: steps.cache.outputs.cache-hit == 'true'
  445. shell: bash
  446. run: |
  447. pushd bin
  448. 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)
  449. popd
  450. 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
  451. - uses: actions/upload-artifact@v4
  452. with:
  453. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  454. path: |
  455. Cardinal-*.exe
  456. Cardinal-*.zip
  457. - uses: softprops/action-gh-release@v1
  458. if: startsWith(github.ref, 'refs/tags/')
  459. with:
  460. tag_name: ${{ github.ref_name }}
  461. name: ${{ github.ref_name }}
  462. draft: false
  463. prerelease: false
  464. files: |
  465. Cardinal-*.exe
  466. Cardinal-*.zip
  467. headless:
  468. runs-on: ubuntu-20.04
  469. steps:
  470. - uses: actions/checkout@v4
  471. with:
  472. submodules: recursive
  473. - name: Set up dependencies
  474. run: |
  475. sudo apt-get update -qq
  476. sudo apt-get remove -yqq libcairo2-dev libx11-dev libx11-dev libxext-dev
  477. sudo apt-get install -yqq liblo-dev
  478. sudo apt-get clean
  479. - name: Build linux (headless)
  480. run: |
  481. make HEADLESS=true features
  482. make HEADLESS=true -j $(nproc)
  483. lto:
  484. runs-on: ubuntu-20.04
  485. steps:
  486. - uses: actions/checkout@v4
  487. with:
  488. submodules: recursive
  489. - name: Set up dependencies
  490. run: |
  491. sudo apt-get update -qq
  492. 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
  493. sudo apt-get clean
  494. - name: Build linux (LTO)
  495. run: |
  496. make features
  497. make WITH_LTO=true -j $(nproc) native
  498. sysdeps:
  499. runs-on: ubuntu-20.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-20.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-20.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.1.0_all.deb
  576. sudo dpkg -i kxstudio-repos_11.1.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