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.

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