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.

679 lines
27KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 7
  5. CARDINAL_UNDER_WINE: 1
  6. CIBUILD: true
  7. DEBIAN_FRONTEND: noninteractive
  8. LIBGL_ALWAYS_SOFTWARE: true
  9. PAWPAW_SKIP_GLIB: 1
  10. PAWPAW_SKIP_LTO: 1
  11. PAWPAW_SKIP_LV2: 1
  12. PAWPAW_SKIP_OPENSSL: 1
  13. PAWPAW_SKIP_SAMPLERATE: 1
  14. PAWPAW_SKIP_TESTS: 1
  15. jobs:
  16. linux:
  17. strategy:
  18. matrix:
  19. target: [aarch64, armhf, i686, riscv64, x86_64]
  20. runs-on: ubuntu-latest
  21. container:
  22. image: ubuntu:20.04
  23. steps:
  24. - name: Install git
  25. run: |
  26. apt-get update -qq && apt-get install -yqq --no-install-recommends ca-certificates curl git openssl
  27. curl -sLO https://launchpad.net/~kxstudio-debian/+archive/ubuntu/toolchain/+files/git_2.34.1-1ubuntu1~bpo20.04.1~ppa1_amd64.deb
  28. curl -sLO https://launchpad.net/~kxstudio-debian/+archive/ubuntu/toolchain/+files/git-man_2.34.1-1ubuntu1~bpo20.04.1~ppa1_all.deb
  29. dpkg -i *.deb
  30. rm *.deb
  31. - uses: actions/checkout@v4
  32. with:
  33. submodules: recursive
  34. - name: Set up build cache
  35. id: cache
  36. uses: actions/cache@v4
  37. with:
  38. path: |
  39. ~/PawPawBuilds
  40. src/Rack/dep/bin
  41. src/Rack/dep/include
  42. src/Rack/dep/lib
  43. src/Rack/dep/share
  44. src/Rack/dep/jansson-2.12
  45. src/Rack/dep/libarchive-3.4.3
  46. src/Rack/dep/libsamplerate-0.1.9
  47. src/Rack/dep/zstd-1.4.5
  48. key: linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  49. - name: Setup dependencies
  50. shell: bash
  51. run: |
  52. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh linux-${{ matrix.target }}
  53. apt-get install -yqq wget zip
  54. - name: Setup dependencies (aarch64)
  55. if: ${{ matrix.target == 'aarch64' }}
  56. shell: bash
  57. run: |
  58. apt-get install -yqq libsdl2-dev:arm64
  59. apt-get clean
  60. - name: Setup dependencies (armhf)
  61. if: ${{ matrix.target == 'armhf' }}
  62. shell: bash
  63. run: |
  64. apt-get install -yqq libsdl2-dev:armhf
  65. apt-get clean
  66. - name: Setup dependencies (i686)
  67. if: ${{ matrix.target == 'i686' }}
  68. shell: bash
  69. run: |
  70. apt-get install -yqq libsdl2-dev:i386
  71. apt-get clean
  72. - name: Setup dependencies (riscv64)
  73. if: ${{ matrix.target == 'riscv64' }}
  74. shell: bash
  75. run: |
  76. apt-get install -yqq libsdl2-dev:riscv64
  77. apt-get clean
  78. - name: Setup dependencies (x86_64)
  79. if: ${{ matrix.target == 'x86_64' }}
  80. shell: bash
  81. run: |
  82. apt-get install -yqq libsdl2-dev
  83. apt-get clean
  84. - name: Set up ccache
  85. uses: hendrikmuhs/ccache-action@v1.2
  86. with:
  87. key: ccache-linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  88. - name: Build extra dependencies
  89. run: |
  90. ./deps/PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh linux-${{ matrix.target }}
  91. - name: Build linux
  92. shell: bash
  93. run: |
  94. export PATH="/usr/lib/ccache:${PATH}"
  95. source deps/PawPaw/local.env linux-${{ matrix.target }}
  96. make features
  97. make HAVE_PULSEAUDIO=false NOOPT=true USING_GLES2=${{ matrix.target == 'aarch64' || matrix.target == 'armhf' }} -j $(nproc)
  98. make unzipfx
  99. - name: Set sha8 (non-release)
  100. if: startsWith(github.ref, 'refs/tags/') != true
  101. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  102. - name: Set sha8 (release)
  103. if: startsWith(github.ref, 'refs/tags/')
  104. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  105. - name: Pack binaries
  106. run: |
  107. 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
  108. - uses: actions/upload-artifact@v4
  109. with:
  110. name: ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  111. path: |
  112. *.tar.gz
  113. - uses: softprops/action-gh-release@v1
  114. if: startsWith(github.ref, 'refs/tags/')
  115. with:
  116. tag_name: ${{ github.ref_name }}
  117. name: ${{ github.ref_name }}
  118. draft: false
  119. prerelease: false
  120. files: |
  121. *.tar.gz
  122. linux-x86_64-debug:
  123. runs-on: ubuntu-20.04
  124. steps:
  125. - uses: actions/checkout@v4
  126. with:
  127. submodules: recursive
  128. - name: Set up dependencies
  129. run: |
  130. sudo apt-get update -qq
  131. 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
  132. sudo apt-get clean
  133. - name: Build linux x86_64 (debug)
  134. env:
  135. LDFLAGS: -static-libgcc -static-libstdc++
  136. run: |
  137. make features
  138. # multiple jobs for building carla, deps and plugins
  139. make DEBUG=true carla deps dgl plugins resources -j $(nproc)
  140. # single job for final build stage, otherwise we might get killed due to OOM
  141. make DEBUG=true HAVE_PULSEAUDIO=false clap lv2 vst2 vst3 -j 1
  142. - name: Set sha8
  143. id: slug
  144. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  145. - name: Pack binaries
  146. run: |
  147. 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
  148. - uses: actions/upload-artifact@v4
  149. with:
  150. name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}
  151. path: |
  152. *.tar.xz
  153. macos:
  154. strategy:
  155. matrix:
  156. target: [universal-10.15]
  157. runs-on: macos-11
  158. steps:
  159. - uses: actions/checkout@v4
  160. with:
  161. submodules: recursive
  162. - name: Set up cache
  163. id: cache
  164. uses: actions/cache@v4
  165. with:
  166. path: |
  167. ~/PawPawBuilds
  168. src/Rack/dep/bin
  169. src/Rack/dep/include
  170. src/Rack/dep/lib
  171. src/Rack/dep/share
  172. src/Rack/dep/jansson-2.12
  173. src/Rack/dep/libarchive-3.4.3
  174. src/Rack/dep/libsamplerate-0.1.9
  175. src/Rack/dep/zstd-1.4.5
  176. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  177. - name: Setup dependencies
  178. run: |
  179. ./deps/PawPaw/.github/workflows/bootstrap-deps.sh macos-${{ matrix.target }}
  180. - name: Build extra dependencies
  181. run: |
  182. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  183. ./deps/PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }} && ./deps/PawPaw/.cleanup.sh macos-${{ matrix.target }}
  184. - name: Set up ccache
  185. if: steps.cache.outputs.cache-hit == 'true'
  186. uses: hendrikmuhs/ccache-action@v1.2
  187. with:
  188. key: ccache-macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  189. - name: Build macOS (base)
  190. if: steps.cache.outputs.cache-hit == 'true'
  191. shell: bash
  192. run: |
  193. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  194. source deps/PawPaw/local.env macos-${{ matrix.target }}
  195. make features
  196. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  197. - name: Build macOS (packaging)
  198. if: steps.cache.outputs.cache-hit == 'true'
  199. shell: bash
  200. run: |
  201. source deps/PawPaw/local.env macos-${{ matrix.target }}
  202. ./utils/create-macos-installer.sh
  203. - name: Set sha8 (non-release)
  204. if: startsWith(github.ref, 'refs/tags/') != true
  205. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  206. - name: Set sha8 (release)
  207. if: startsWith(github.ref, 'refs/tags/')
  208. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  209. - name: Rename macOS bundle
  210. if: steps.cache.outputs.cache-hit == 'true'
  211. run: |
  212. mv ${{ github.event.repository.name }}-macOS.pkg ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  213. - uses: actions/upload-artifact@v4
  214. with:
  215. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  216. path: |
  217. ${{ github.event.repository.name }}-*.pkg
  218. - uses: softprops/action-gh-release@v1
  219. if: startsWith(github.ref, 'refs/tags/')
  220. with:
  221. tag_name: ${{ github.ref_name }}
  222. name: ${{ github.ref_name }}
  223. draft: false
  224. prerelease: false
  225. files: |
  226. ${{ github.event.repository.name }}-*.pkg
  227. modaudio:
  228. strategy:
  229. matrix:
  230. include:
  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-20.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 python 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) -C src/CardinalMiniSep 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-20.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-20.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) native
  497. sysdeps:
  498. runs-on: ubuntu-20.04
  499. steps:
  500. - uses: actions/checkout@v4
  501. with:
  502. submodules: recursive
  503. - name: Set up dependencies
  504. run: |
  505. sudo apt-get update -qq
  506. 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
  507. sudo apt-get clean
  508. - name: Build linux (sysdeps)
  509. run: |
  510. make features
  511. make SYSDEPS=true -j $(nproc)
  512. source-tarball:
  513. runs-on: ubuntu-20.04
  514. steps:
  515. - uses: actions/checkout@v4
  516. with:
  517. submodules: recursive
  518. - name: Set up dependencies
  519. run: |
  520. sudo apt-get update -qq
  521. sudo apt-get install -yqq liblo-dev
  522. sudo apt-get clean
  523. - name: Create source tarball
  524. run: |
  525. make HEADLESS=true tarball
  526. make HEADLESS=true tarball+deps
  527. - name: Set sha8 (non-release)
  528. if: startsWith(github.ref, 'refs/tags/') != true
  529. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  530. - name: Set sha8 (release)
  531. if: startsWith(github.ref, 'refs/tags/')
  532. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  533. - uses: actions/upload-artifact@v4
  534. with:
  535. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  536. path: |
  537. /home/runner/cardinal*.tar.xz
  538. /home/runner/*/cardinal*.tar.xz
  539. /home/runner/*/*/cardinal*.tar.xz
  540. - uses: softprops/action-gh-release@v1
  541. if: startsWith(github.ref, 'refs/tags/')
  542. with:
  543. tag_name: ${{ github.ref_name }}
  544. name: ${{ github.ref_name }}
  545. draft: false
  546. prerelease: false
  547. files: |
  548. /home/runner/cardinal*.tar.xz
  549. /home/runner/*/cardinal*.tar.xz
  550. /home/runner/*/*/cardinal*.tar.xz
  551. plugin-validation:
  552. runs-on: ubuntu-20.04
  553. steps:
  554. - uses: actions/checkout@v4
  555. with:
  556. submodules: recursive
  557. - name: Set up cache
  558. id: cache
  559. uses: actions/cache@v4
  560. with:
  561. path: |
  562. src/Rack/dep/bin
  563. src/Rack/dep/include
  564. src/Rack/dep/lib
  565. src/Rack/dep/share
  566. src/Rack/dep/jansson-2.12
  567. src/Rack/dep/libarchive-3.4.3
  568. src/Rack/dep/libsamplerate-0.1.9
  569. src/Rack/dep/zstd-1.4.5
  570. key: pluginval-v${{ env.CACHE_VERSION }}
  571. - name: Set up dependencies
  572. run: |
  573. # custom repos
  574. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  575. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  576. sudo apt-get update -qq
  577. # build-deps
  578. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  579. # runtime testing
  580. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  581. sudo apt-get clean
  582. # multiple jobs for building carla, deps and plugins
  583. - name: Build Cardinal (carla, deps and plugins)
  584. env:
  585. CFLAGS: -g
  586. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  587. LDFLAGS: -static-libgcc -static-libstdc++
  588. run: |
  589. make features
  590. make NOOPT=true SKIP_STRIPPING=true carla deps dgl plugins resources -j $(nproc)
  591. # single job for final build stage, otherwise we might get killed due to OOM
  592. - name: Build Cardinal (final build stage)
  593. env:
  594. CFLAGS: -g
  595. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  596. LDFLAGS: -static-libgcc -static-libstdc++
  597. run: |
  598. make features
  599. make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  600. make NOOPT=true -j 1
  601. ./dpf/utils/generate-ttl.sh
  602. - name: Run Cardinal self-tests
  603. run: |
  604. # --exit-on-first-error=yes
  605. xvfb-run valgrind \
  606. --gen-suppressions=all \
  607. --error-exitcode=255 \
  608. --leak-check=no \
  609. --track-origins=yes \
  610. --keep-debuginfo=yes \
  611. --suppressions=./dpf/utils/valgrind-dpf.supp \
  612. ./bin/Cardinal selftest
  613. - name: Validate LV2 ttl syntax
  614. run: |
  615. lv2_validate \
  616. /usr/lib/lv2/kx-meta/*.ttl \
  617. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  618. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  619. /usr/lib/lv2/mod.lv2/*.ttl \
  620. /usr/lib/lv2/modgui.lv2/*.ttl \
  621. ./bin/*.lv2/*.ttl
  622. - name: Validate LV2 metadata and binaries
  623. run: |
  624. export LV2_PATH=/tmp/lv2-path
  625. mkdir ${LV2_PATH}
  626. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  627. 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}
  628. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  629. - name: Test LV2 plugin
  630. run: |
  631. export LV2_PATH=/tmp/lv2-path
  632. for p in $(lv2ls); do \
  633. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  634. xvfb-run valgrind \
  635. --error-exitcode=255 \
  636. --leak-check=no \
  637. --track-origins=yes \
  638. --keep-debuginfo=yes \
  639. --suppressions=./dpf/utils/valgrind-dpf.supp \
  640. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  641. done
  642. - name: Test VST2 plugin
  643. run: |
  644. for p in $(ls bin/*.vst/*.so); do \
  645. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  646. xvfb-run valgrind \
  647. --error-exitcode=255 \
  648. --leak-check=no \
  649. --track-origins=yes \
  650. --keep-debuginfo=yes \
  651. --suppressions=./dpf/utils/valgrind-dpf.supp \
  652. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  653. done
  654. - name: Test VST3 plugin
  655. run: |
  656. for p in $(ls bin/ | grep vst3); do \
  657. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  658. xvfb-run valgrind \
  659. --error-exitcode=255 \
  660. --leak-check=no \
  661. --track-origins=yes \
  662. --keep-debuginfo=yes \
  663. --suppressions=./dpf/utils/valgrind-dpf.supp \
  664. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  665. done