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: 10
  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. debug: [0, 1]
  158. target: [universal-10.15]
  159. runs-on: macos-12
  160. steps:
  161. - uses: actions/checkout@v4
  162. with:
  163. submodules: recursive
  164. - name: Set debug or release
  165. shell: bash
  166. run: |
  167. if [ "${{ matrix.debug }}" -eq 1 ]; then
  168. echo "TARGET_SUFFIX=-debug" >> $GITHUB_ENV
  169. echo "PAWPAW_DEBUG=1" >> $GITHUB_ENV
  170. fi
  171. - name: Set up cache
  172. id: cache
  173. uses: actions/cache@v4
  174. with:
  175. path: |
  176. ~/PawPawBuilds
  177. src/Rack/dep/bin
  178. src/Rack/dep/include
  179. src/Rack/dep/lib
  180. src/Rack/dep/share
  181. src/Rack/dep/jansson-2.12
  182. src/Rack/dep/libarchive-3.4.3
  183. src/Rack/dep/libsamplerate-0.1.9
  184. src/Rack/dep/zstd-1.4.5
  185. key: macos-${{ matrix.target }}${{ env.TARGET_SUFFIX }}-v${{ env.CACHE_VERSION }}
  186. - name: Setup dependencies
  187. run: |
  188. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh macos-${{ matrix.target }}
  189. - name: Build extra dependencies
  190. run: |
  191. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  192. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  193. - name: Set up ccache
  194. if: steps.cache.outputs.cache-hit == 'true'
  195. uses: hendrikmuhs/ccache-action@v1.2
  196. with:
  197. key: ccache-macos-${{ matrix.target }}${{ env.TARGET_SUFFIX }}-v${{ env.CACHE_VERSION }}
  198. - name: Build macOS (base)
  199. if: steps.cache.outputs.cache-hit == 'true'
  200. shell: bash
  201. run: |
  202. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  203. source deps/PawPaw/local.env macos-${{ matrix.target }}
  204. make features
  205. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  206. - name: Build macOS (packaging)
  207. if: steps.cache.outputs.cache-hit == 'true'
  208. shell: bash
  209. run: |
  210. source deps/PawPaw/local.env macos-${{ matrix.target }}
  211. ./utils/create-macos-installer.sh
  212. - name: Set sha8 (non-release)
  213. if: startsWith(github.ref, 'refs/tags/') != true
  214. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  215. - name: Set sha8 (release)
  216. if: startsWith(github.ref, 'refs/tags/')
  217. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  218. - name: Rename macOS bundle
  219. if: steps.cache.outputs.cache-hit == 'true'
  220. run: |
  221. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}${{ env.TARGET_SUFFIX }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  222. - uses: actions/upload-artifact@v4
  223. with:
  224. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}${{ env.TARGET_SUFFIX }}-${{ github.event.pull_request.number || env.SHA8 }}
  225. path: |
  226. ${{ github.event.repository.name }}-*.pkg
  227. - uses: softprops/action-gh-release@v1
  228. if: ${{ matrix.debug == '0' && startsWith(github.ref, 'refs/tags/') }}
  229. with:
  230. tag_name: ${{ github.ref_name }}
  231. name: ${{ github.ref_name }}
  232. draft: false
  233. prerelease: false
  234. files: |
  235. ${{ github.event.repository.name }}-*.pkg
  236. modaudio:
  237. strategy:
  238. matrix:
  239. include:
  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-20.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 python 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. 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-20.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-20.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-20.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-20.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-20.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.1.0_all.deb
  585. sudo dpkg -i kxstudio-repos_11.1.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