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.

681 lines
27KB

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