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.

688 lines
27KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 6
  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@v3
  32. with:
  33. submodules: recursive
  34. - name: Set up build cache
  35. id: cache
  36. uses: actions/cache@v3
  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@v3
  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@v3
  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 -z -f ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}.tar.gz -C bin $(ls bin | grep -e lv2 -e vst -e clap) ../LICENSE ../README.md ../docs
  148. - uses: actions/upload-artifact@v3
  149. with:
  150. name: ${{ github.event.repository.name }}-linux-x86_64-debug-${{ github.event.pull_request.number || env.SHA8 }}
  151. path: |
  152. *.tar.gz
  153. macos:
  154. strategy:
  155. matrix:
  156. target: [universal-10.15]
  157. runs-on: macos-11
  158. steps:
  159. - uses: actions/checkout@v3
  160. with:
  161. submodules: recursive
  162. - name: Set up cache
  163. id: cache
  164. uses: actions/cache@v3
  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 (AU using juce)
  198. if: steps.cache.outputs.cache-hit == 'true'
  199. shell: bash
  200. run: |
  201. export PATH="/usr/local/opt/ccache/libexec:${PATH}"
  202. source deps/PawPaw/local.env macos-${{ matrix.target }}
  203. mkdir -p jucewrapper/build
  204. pushd jucewrapper/build; cmake -DCMAKE_BUILD_TYPE=Release .. && make VERBOSE=1 -j $(sysctl -n hw.logicalcpu); popd
  205. mv jucewrapper/build/*_artefacts/Release/AU/*.component bin/
  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 }}-${{ github.event.pull_request.number || env.SHA8 }}.pkg
  222. - uses: actions/upload-artifact@v3
  223. with:
  224. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  225. path: |
  226. ${{ github.event.repository.name }}-*.pkg
  227. - uses: softprops/action-gh-release@v1
  228. if: 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@v3
  250. with:
  251. submodules: recursive
  252. - name: Set up cache
  253. uses: actions/cache@v3
  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@v3
  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@v3
  295. with:
  296. submodules: recursive
  297. - name: Set up cache
  298. id: cache
  299. uses: actions/cache@v3
  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) -C src/CardinalMiniSep 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@v3
  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@v3
  392. with:
  393. submodules: recursive
  394. - name: Set up cache
  395. id: cache
  396. uses: actions/cache@v3
  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@v3
  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@v3
  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@v3
  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) native
  506. sysdeps:
  507. runs-on: ubuntu-20.04
  508. steps:
  509. - uses: actions/checkout@v3
  510. with:
  511. submodules: recursive
  512. - name: Set up dependencies
  513. run: |
  514. sudo apt-get update -qq
  515. 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
  516. sudo apt-get clean
  517. - name: Build linux (sysdeps)
  518. run: |
  519. make features
  520. make SYSDEPS=true -j $(nproc)
  521. source-tarball:
  522. runs-on: ubuntu-20.04
  523. steps:
  524. - uses: actions/checkout@v3
  525. with:
  526. submodules: recursive
  527. - name: Set up dependencies
  528. run: |
  529. sudo apt-get update -qq
  530. sudo apt-get install -yqq liblo-dev
  531. sudo apt-get clean
  532. - name: Create source tarball
  533. run: |
  534. make HEADLESS=true tarball
  535. make HEADLESS=true tarball+deps
  536. - name: Set sha8 (non-release)
  537. if: startsWith(github.ref, 'refs/tags/') != true
  538. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  539. - name: Set sha8 (release)
  540. if: startsWith(github.ref, 'refs/tags/')
  541. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  542. - uses: actions/upload-artifact@v3
  543. with:
  544. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || env.SHA8 }}
  545. path: |
  546. /home/runner/cardinal*.tar.xz
  547. /home/runner/*/cardinal*.tar.xz
  548. /home/runner/*/*/cardinal*.tar.xz
  549. - uses: softprops/action-gh-release@v1
  550. if: startsWith(github.ref, 'refs/tags/')
  551. with:
  552. tag_name: ${{ github.ref_name }}
  553. name: ${{ github.ref_name }}
  554. draft: false
  555. prerelease: false
  556. files: |
  557. /home/runner/cardinal*.tar.xz
  558. /home/runner/*/cardinal*.tar.xz
  559. /home/runner/*/*/cardinal*.tar.xz
  560. plugin-validation:
  561. runs-on: ubuntu-20.04
  562. steps:
  563. - uses: actions/checkout@v3
  564. with:
  565. submodules: recursive
  566. - name: Set up cache
  567. id: cache
  568. uses: actions/cache@v3
  569. with:
  570. path: |
  571. src/Rack/dep/bin
  572. src/Rack/dep/include
  573. src/Rack/dep/lib
  574. src/Rack/dep/share
  575. src/Rack/dep/jansson-2.12
  576. src/Rack/dep/libarchive-3.4.3
  577. src/Rack/dep/libsamplerate-0.1.9
  578. src/Rack/dep/zstd-1.4.5
  579. key: pluginval-v${{ env.CACHE_VERSION }}
  580. - name: Set up dependencies
  581. run: |
  582. # custom repos
  583. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  584. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  585. sudo apt-get update -qq
  586. # build-deps
  587. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev liblo-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev
  588. # runtime testing
  589. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  590. sudo apt-get clean
  591. # multiple jobs for building carla, deps and plugins
  592. - name: Build Cardinal (carla, deps and plugins)
  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 carla deps dgl plugins resources -j $(nproc)
  600. # single job for final build stage, otherwise we might get killed due to OOM
  601. - name: Build Cardinal (final build stage)
  602. env:
  603. CFLAGS: -g
  604. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING -Wno-pmf-conversions
  605. LDFLAGS: -static-libgcc -static-libstdc++
  606. run: |
  607. make features
  608. make NOOPT=true SKIP_STRIPPING=true -j 1 -C src jack
  609. make NOOPT=true -j 1
  610. ./dpf/utils/generate-ttl.sh
  611. - name: Run Cardinal self-tests
  612. run: |
  613. # --exit-on-first-error=yes
  614. xvfb-run valgrind \
  615. --gen-suppressions=all \
  616. --error-exitcode=255 \
  617. --leak-check=no \
  618. --track-origins=yes \
  619. --keep-debuginfo=yes \
  620. --suppressions=./dpf/utils/valgrind-dpf.supp \
  621. ./bin/Cardinal selftest
  622. - name: Validate LV2 ttl syntax
  623. run: |
  624. lv2_validate \
  625. /usr/lib/lv2/kx-meta/*.ttl \
  626. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  627. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  628. /usr/lib/lv2/mod.lv2/*.ttl \
  629. /usr/lib/lv2/modgui.lv2/*.ttl \
  630. ./bin/*.lv2/*.ttl
  631. - name: Validate LV2 metadata and binaries
  632. run: |
  633. export LV2_PATH=/tmp/lv2-path
  634. mkdir ${LV2_PATH}
  635. mv bin/CardinalFX.lv2 bin/CardinalSynth.lv2 ${LV2_PATH}
  636. 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}
  637. xvfb-run lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  638. - name: Test LV2 plugin
  639. run: |
  640. export LV2_PATH=/tmp/lv2-path
  641. for p in $(lv2ls); do \
  642. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  643. xvfb-run valgrind \
  644. --error-exitcode=255 \
  645. --leak-check=no \
  646. --track-origins=yes \
  647. --keep-debuginfo=yes \
  648. --suppressions=./dpf/utils/valgrind-dpf.supp \
  649. /usr/lib/carla/carla-bridge-native lv2 "" ${p}; \
  650. done
  651. - name: Test VST2 plugin
  652. run: |
  653. for p in $(ls bin/*.vst/*.so); do \
  654. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  655. xvfb-run valgrind \
  656. --error-exitcode=255 \
  657. --leak-check=no \
  658. --track-origins=yes \
  659. --keep-debuginfo=yes \
  660. --suppressions=./dpf/utils/valgrind-dpf.supp \
  661. /usr/lib/carla/carla-bridge-native vst2 ./${p} ""; \
  662. done
  663. - name: Test VST3 plugin
  664. run: |
  665. for p in $(ls bin/ | grep vst3); do \
  666. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  667. xvfb-run valgrind \
  668. --error-exitcode=255 \
  669. --leak-check=no \
  670. --track-origins=yes \
  671. --keep-debuginfo=yes \
  672. --suppressions=./dpf/utils/valgrind-dpf.supp \
  673. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} ""; \
  674. done