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.

330 lines
15KB

  1. name: build
  2. on: [push, pull_request]
  3. env:
  4. CACHE_VERSION: 6
  5. DEBIAN_FRONTEND: noninteractive
  6. HOMEBREW_NO_AUTO_UPDATE: 1
  7. PAWPAW_SKIP_LTO: 1
  8. WITH_LTO: false
  9. jobs:
  10. linux:
  11. strategy:
  12. matrix:
  13. target: [aarch64, armhf, i386, riscv64, x86_64]
  14. runs-on: ubuntu-20.04
  15. steps:
  16. - uses: actions/checkout@v3
  17. with:
  18. submodules: recursive
  19. - name: Set up cache
  20. uses: actions/cache@v3
  21. with:
  22. path: |
  23. ~/PawPawBuilds
  24. key: linux-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  25. - name: Fix GitHub's mess
  26. run: |
  27. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  28. sudo apt-get update -qq
  29. sudo apt-get install -yqq --allow-downgrades libgd3/focal libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal
  30. sudo apt-get purge -yqq libclang* libgbm* libllvm* libmono* moby* mono* php* libgdiplus libpcre2-posix3 libzip4
  31. - name: Set up dependencies (aarch64)
  32. if: ${{ matrix.target == 'aarch64' }}
  33. run: |
  34. sudo dpkg --add-architecture arm64
  35. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  36. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-arm64.list
  37. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list
  38. echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-arm64.list
  39. sudo apt-get update -qq
  40. sudo apt-get install -yqq g++-aarch64-linux-gnu libasound2-dev:arm64 libdbus-1-dev:arm64 libgl1-mesa-dev:arm64 libglib2.0-dev:arm64 libx11-dev:arm64 libxcursor-dev:arm64 libxext-dev:arm64 libxrandr-dev:arm64 gperf qemu-user-static
  41. - name: Set up dependencies (armhf)
  42. if: ${{ matrix.target == 'armhf' }}
  43. run: |
  44. sudo dpkg --add-architecture armhf
  45. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  46. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-armhf.list
  47. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list
  48. echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-armhf.list
  49. sudo apt-get update -qq
  50. sudo apt-get install -yqq g++-arm-linux-gnueabihf libasound2-dev:armhf libdbus-1-dev:armhf libgl1-mesa-dev:armhf libglib2.0-dev:armhf libx11-dev:armhf libxcursor-dev:armhf libxext-dev:armhf libxrandr-dev:armhf gperf qemu-user-static
  51. - name: Set up dependencies (i386)
  52. if: ${{ matrix.target == 'i386' }}
  53. run: |
  54. sudo dpkg --add-architecture i386
  55. sudo apt-get update -qq
  56. sudo apt-get install -yqq g++-i686-linux-gnu libasound2-dev:i386 libdbus-1-dev:i386 libgl1-mesa-dev:i386 libglib2.0-dev:i386 libx11-dev:i386 libxcursor-dev:i386 libxext-dev:i386 libxrandr-dev:i386 gperf
  57. sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 libwine-dev:i386 wine-stable wine64-tools
  58. - name: Set up dependencies (riscv64)
  59. if: ${{ matrix.target == 'riscv64' }}
  60. run: |
  61. sudo dpkg --add-architecture riscv64
  62. sudo sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list
  63. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ports-riscv64.list
  64. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list
  65. echo "deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ports-riscv64.list
  66. sudo apt-get update -qq
  67. sudo apt-get install -yqq g++-riscv64-linux-gnu libasound2-dev:riscv64 libdbus-1-dev:riscv64 libgl1-mesa-dev:riscv64 libglapi-mesa:riscv64 libglvnd0:riscv64 libglib2.0-dev:riscv64 libx11-dev:riscv64 libxcursor-dev:riscv64 libxext-dev:riscv64 libxrandr-dev:riscv64 gperf qemu-user-static
  68. - name: Set up dependencies (x86_64)
  69. if: ${{ matrix.target == 'x86_64' }}
  70. run: |
  71. sudo dpkg --add-architecture i386
  72. sudo apt-get update -qq
  73. sudo apt-get install -yqq libasound2-dev libdbus-1-dev libgl1-mesa-dev libglib2.0-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  74. sudo apt-get install -yqq g++-multilib libx11-dev:i386
  75. sudo apt-get install -yqq binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 mingw-w64 wine-stable wine64-tools
  76. - name: Build extra dependencies
  77. run: |
  78. git clone --depth=1 https://github.com/DISTRHO/PawPaw.git
  79. ./PawPaw/bootstrap-cardinal.sh linux-${{ matrix.target }}
  80. - name: Build linux
  81. run: |
  82. source PawPaw/local.env linux-${{ matrix.target }}
  83. make features
  84. make NOOPT=true -j $(nproc)
  85. - name: Build linux x86_64 extra (part1)
  86. if: ${{ matrix.target == 'x86_64' }}
  87. run: |
  88. source PawPaw/local.env linux-${{ matrix.target }}
  89. make NOOPT=true all extra-posix32 extra-win32 extra-win64 extra-wine64 -j $(nproc)
  90. - name: Build linux x86_64 extra (part2)
  91. if: ${{ matrix.target == 'x86_64' }}
  92. run: |
  93. sudo apt-get install -yqq libwine-dev:i386
  94. source PawPaw/local.env linux
  95. make NOOPT=true extra-wine32 -j $(nproc)
  96. make CARLA_EXTRA_TARGETS=true NOOPT=true -j $(nproc)
  97. - name: Set sha8
  98. id: slug
  99. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  100. - uses: actions/upload-artifact@v3
  101. with:
  102. name: ${{ github.event.repository.name }}-linux-${{ matrix.target }}-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  103. path: |
  104. bin/*
  105. macos:
  106. strategy:
  107. matrix:
  108. target: [intel, universal]
  109. runs-on: macos-11
  110. steps:
  111. - uses: actions/checkout@v3
  112. with:
  113. submodules: recursive
  114. - name: Set up cache
  115. uses: actions/cache@v3
  116. with:
  117. path: |
  118. ~/PawPawBuilds
  119. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  120. - name: Build extra dependencies
  121. run: |
  122. git clone --depth=1 https://github.com/DISTRHO/PawPaw.git
  123. ./PawPaw/bootstrap-cardinal.sh macos-${{ matrix.target }}
  124. - name: Build macOS
  125. run: |
  126. source PawPaw/local.env macos-${{ matrix.target }}
  127. make features
  128. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  129. ./dpf/utils/package-osx-bundles.sh
  130. - name: Set sha8
  131. id: slug
  132. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  133. - uses: actions/upload-artifact@v3
  134. with:
  135. name: ${{ github.event.repository.name }}-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  136. path: |
  137. *-macOS.pkg
  138. bin/*
  139. !bin/*-ladspa.dylib
  140. !bin/*-dssi.dylib
  141. !bin/clap
  142. !bin/lv2
  143. !bin/vst2
  144. !bin/vst3
  145. windows:
  146. strategy:
  147. matrix:
  148. target: [win32, win64]
  149. runs-on: ubuntu-22.04
  150. steps:
  151. - uses: actions/checkout@v3
  152. with:
  153. submodules: recursive
  154. - name: Set up cache
  155. uses: actions/cache@v3
  156. with:
  157. path: |
  158. ~/PawPawBuilds
  159. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  160. - name: Fix GitHub's mess
  161. run: |
  162. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  163. sudo apt-get update -qq
  164. sudo apt-get install -yqq --allow-downgrades libgd3/jammy
  165. sudo apt-get purge -yqq libmono* moby* mono* msbuild* php* libgdiplus libpcre2-posix3 libpq5 nuget
  166. dpkg -l
  167. - name: Set up dependencies (win32)
  168. if: ${{ matrix.target == 'win32' }}
  169. run: |
  170. sudo dpkg --add-architecture i386
  171. sudo apt-get update -qq
  172. sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 gperf mingw-w64 wine-stable
  173. - name: Set up dependencies (win64)
  174. if: ${{ matrix.target == 'win64' }}
  175. run: |
  176. sudo dpkg --add-architecture i386
  177. sudo apt-get update -qq
  178. sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 gperf mingw-w64 wine-stable
  179. - name: Build extra dependencies
  180. run: |
  181. git clone --depth=1 https://github.com/DISTRHO/PawPaw.git
  182. ./PawPaw/bootstrap-cardinal.sh ${{ matrix.target }}
  183. - name: Build cross-compiled
  184. run: |
  185. source PawPaw/local.env ${{ matrix.target }}
  186. make features
  187. make CARLA_EXTRA_TARGETS=true NOOPT=true -j $(nproc)
  188. - name: Set sha8
  189. id: slug
  190. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  191. - uses: actions/upload-artifact@v3
  192. with:
  193. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  194. path: |
  195. bin/*
  196. !bin/*-ladspa.dll
  197. !bin/*-dssi.dll
  198. source-tarball:
  199. runs-on: ubuntu-20.04
  200. steps:
  201. - uses: actions/checkout@v3
  202. with:
  203. submodules: recursive
  204. - name: Set up dependencies
  205. run: |
  206. sudo apt-get update -qq
  207. sudo apt-get install -yqq libgl1-mesa-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  208. - name: Create source tarball
  209. run: |
  210. make tarball
  211. - name: Set sha8 (non-release)
  212. if: startsWith(github.ref, 'refs/tags/') != true
  213. id: slug1
  214. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  215. - name: Set sha8 (release)
  216. if: startsWith(github.ref, 'refs/tags/')
  217. id: slug2
  218. run: echo "::set-output name=sha8::$(echo ${{ github.ref_name }})"
  219. - name: Set sha8
  220. id: slug
  221. run: echo "::set-output name=sha8::$(echo ${{ steps.slug1.outputs.sha8 || steps.slug2.outputs.sha8 }})"
  222. - uses: actions/upload-artifact@v3
  223. with:
  224. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  225. path: |
  226. /home/runner/*.tar.xz
  227. /home/runner/*/*.tar.xz
  228. /home/runner/*/*/*.tar.xz
  229. - uses: softprops/action-gh-release@v1
  230. if: startsWith(github.ref, 'refs/tags/')
  231. with:
  232. tag_name: ${{ github.ref_name }}
  233. name: ${{ github.ref_name }}
  234. draft: false
  235. prerelease: false
  236. files: |
  237. /home/runner/*.tar.xz
  238. /home/runner/*/*.tar.xz
  239. /home/runner/*/*/*.tar.xz
  240. plugin-validation:
  241. runs-on: ubuntu-20.04
  242. steps:
  243. - uses: actions/checkout@v3
  244. with:
  245. submodules: recursive
  246. - name: Set up dependencies
  247. run: |
  248. # custom repos
  249. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  250. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  251. sudo apt-get update -qq
  252. # build-deps
  253. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  254. # runtime testing
  255. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  256. - name: Build plugins
  257. env:
  258. CFLAGS: -g
  259. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING
  260. LDFLAGS: -static-libgcc -static-libstdc++
  261. run: |
  262. make features
  263. make NOOPT=true SKIP_STRIPPING=true -j $(nproc)
  264. - name: Run Ildaeil self-tests
  265. run: |
  266. xvfb-run valgrind \
  267. --gen-suppressions=all \
  268. --error-exitcode=255 \
  269. --leak-check=no \
  270. --track-origins=yes \
  271. --suppressions=./dpf/utils/valgrind-dpf.supp \
  272. ./bin/Ildaeil-FX selftest
  273. - name: Validate LV2 ttl syntax
  274. run: |
  275. lv2_validate \
  276. /usr/lib/lv2/mod.lv2/*.ttl \
  277. /usr/lib/lv2/kx-meta/*.ttl \
  278. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  279. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  280. ./bin/*.lv2/*.ttl
  281. - name: Validate LV2 metadata and binaries
  282. run: |
  283. export LV2_PATH=/tmp/lv2-path
  284. mkdir ${LV2_PATH}
  285. cp -r bin/*.lv2 \
  286. /usr/lib/lv2/{atom,buf-size,core,data-access,kx-control-input-port-change-request,kx-programs,instance-access,midi,parameters,port-groups,port-props,options,patch,presets,resize-port,state,time,ui,units,urid,worker}.lv2 \
  287. ${LV2_PATH}
  288. lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  289. - name: Test LV2 plugins
  290. run: |
  291. export LV2_PATH=/tmp/lv2-path
  292. for p in $(lv2ls); do \
  293. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  294. valgrind \
  295. --error-exitcode=255 \
  296. --leak-check=full \
  297. --track-origins=yes \
  298. --suppressions=./dpf/utils/valgrind-dpf.supp \
  299. /usr/lib/carla/carla-bridge-native lv2 "" ${p} 1>/dev/null; \
  300. done
  301. - name: Test VST2 plugins
  302. run: |
  303. for p in $(find bin/ | grep -e vst.so -e '.*\.vst/.*\.so'); do \
  304. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  305. valgrind \
  306. --error-exitcode=255 \
  307. --leak-check=full \
  308. --track-origins=yes \
  309. --suppressions=./dpf/utils/valgrind-dpf.supp \
  310. /usr/lib/carla/carla-bridge-native vst2 ./${p} "" 1>/dev/null; \
  311. done
  312. - name: Test VST3 plugins
  313. run: |
  314. for p in $(ls bin/ | grep vst3); do \
  315. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  316. valgrind \
  317. --error-exitcode=255 \
  318. --leak-check=full \
  319. --track-origins=yes \
  320. --suppressions=./dpf/utils/valgrind-dpf.supp \
  321. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} "" 1>/dev/null; \
  322. done