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.

325 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. pushd PawPaw; source local.env linux-${{ matrix.target }}; popd
  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. pushd PawPaw; source local.env linux-${{ matrix.target }}; popd
  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. pushd PawPaw; source local.env linux-${{ matrix.target }}; popd
  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-universal:
  106. runs-on: macos-11
  107. steps:
  108. - uses: actions/checkout@v3
  109. with:
  110. submodules: recursive
  111. - name: Set up cache
  112. uses: actions/cache@v3
  113. with:
  114. path: |
  115. ~/PawPawBuilds
  116. key: macos-universal-v${{ env.CACHE_VERSION }}
  117. - name: Build extra dependencies
  118. run: |
  119. git clone --depth=1 https://github.com/DISTRHO/PawPaw.git
  120. ./PawPaw/bootstrap-cardinal.sh macos-universal
  121. - name: Build macOS universal
  122. run: |
  123. pushd PawPaw; source local.env macos-universal; popd
  124. make features
  125. make NOOPT=true -j $(sysctl -n hw.logicalcpu)
  126. ./dpf/utils/package-osx-bundles.sh
  127. - name: Set sha8
  128. id: slug
  129. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  130. - uses: actions/upload-artifact@v3
  131. with:
  132. name: ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  133. path: |
  134. *-macOS.pkg
  135. bin/*
  136. !bin/*-ladspa.dylib
  137. !bin/*-dssi.dylib
  138. !bin/lv2
  139. !bin/vst2
  140. !bin/vst3
  141. windows:
  142. strategy:
  143. matrix:
  144. target: [win32, win64]
  145. runs-on: ubuntu-22.04
  146. steps:
  147. - uses: actions/checkout@v3
  148. with:
  149. submodules: recursive
  150. - name: Set up cache
  151. uses: actions/cache@v3
  152. with:
  153. path: |
  154. ~/PawPawBuilds
  155. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  156. - name: Fix GitHub's mess
  157. run: |
  158. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  159. sudo apt-get update -qq
  160. sudo apt-get install -yqq --allow-downgrades libgd3/jammy
  161. sudo apt-get purge -yqq libmono* moby* mono* msbuild* php* libgdiplus libpcre2-posix3 nuget
  162. - name: Set up dependencies (win32)
  163. if: ${{ matrix.target == 'win32' }}
  164. run: |
  165. sudo dpkg --add-architecture i386
  166. sudo apt-get update -qq
  167. sudo apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 gperf mingw-w64 wine-stable
  168. - name: Set up dependencies (win64)
  169. if: ${{ matrix.target == 'win64' }}
  170. run: |
  171. sudo dpkg --add-architecture i386
  172. sudo apt-get update -qq
  173. sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 gperf mingw-w64 wine-stable
  174. - name: Build extra dependencies
  175. run: |
  176. git clone --depth=1 https://github.com/DISTRHO/PawPaw.git
  177. ./PawPaw/bootstrap-cardinal.sh ${{ matrix.target }}
  178. - name: Build cross-compiled
  179. run: |
  180. pushd PawPaw; source local.env ${{ matrix.target }}; popd
  181. make features
  182. make CARLA_EXTRA_TARGETS=true NOOPT=true -j $(nproc)
  183. - name: Set sha8
  184. id: slug
  185. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  186. - uses: actions/upload-artifact@v3
  187. with:
  188. name: ${{ github.event.repository.name }}-${{ matrix.target }}-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  189. path: |
  190. bin/*
  191. !bin/*-ladspa.dll
  192. !bin/*-dssi.dll
  193. source-tarball:
  194. runs-on: ubuntu-20.04
  195. steps:
  196. - uses: actions/checkout@v3
  197. with:
  198. submodules: recursive
  199. - name: Set up dependencies
  200. run: |
  201. sudo apt-get update -qq
  202. sudo apt-get install -yqq libgl1-mesa-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  203. - name: Create source tarball
  204. run: |
  205. make tarball
  206. - name: Set sha8 (non-release)
  207. if: startsWith(github.ref, 'refs/tags/') != true
  208. id: slug1
  209. run: echo "::set-output name=sha8::$(echo ${{ github.sha }} | cut -c1-8)"
  210. - name: Set sha8 (release)
  211. if: startsWith(github.ref, 'refs/tags/')
  212. id: slug2
  213. run: echo "::set-output name=sha8::$(echo ${{ github.ref_name }})"
  214. - name: Set sha8
  215. id: slug
  216. run: echo "::set-output name=sha8::$(echo ${{ steps.slug1.outputs.sha8 || steps.slug2.outputs.sha8 }})"
  217. - uses: actions/upload-artifact@v3
  218. with:
  219. name: ${{ github.event.repository.name }}-source-${{ github.event.pull_request.number || steps.slug.outputs.sha8 }}
  220. path: |
  221. /home/runner/*.tar.xz
  222. /home/runner/*/*.tar.xz
  223. /home/runner/*/*/*.tar.xz
  224. - uses: softprops/action-gh-release@v1
  225. if: startsWith(github.ref, 'refs/tags/')
  226. with:
  227. tag_name: ${{ github.ref_name }}
  228. name: ${{ github.ref_name }}
  229. draft: false
  230. prerelease: false
  231. files: |
  232. /home/runner/*.tar.xz
  233. /home/runner/*/*.tar.xz
  234. /home/runner/*/*/*.tar.xz
  235. plugin-validation:
  236. runs-on: ubuntu-20.04
  237. steps:
  238. - uses: actions/checkout@v3
  239. with:
  240. submodules: recursive
  241. - name: Set up dependencies
  242. run: |
  243. # custom repos
  244. wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_11.1.0_all.deb
  245. sudo dpkg -i kxstudio-repos_11.1.0_all.deb
  246. sudo apt-get update -qq
  247. # build-deps
  248. sudo apt-get install -yqq libdbus-1-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev gperf
  249. # runtime testing
  250. sudo apt-get install -yqq carla-git lilv-utils lv2-dev lv2lint kxstudio-lv2-extensions mod-lv2-extensions valgrind xvfb
  251. - name: Build plugins
  252. env:
  253. CFLAGS: -g
  254. CXXFLAGS: -g -DDPF_ABORT_ON_ERROR -DDPF_RUNTIME_TESTING
  255. LDFLAGS: -static-libgcc -static-libstdc++
  256. run: |
  257. make features
  258. make NOOPT=true SKIP_STRIPPING=true -j $(nproc)
  259. - name: Run Ildaeil self-tests
  260. run: |
  261. xvfb-run valgrind \
  262. --gen-suppressions=all \
  263. --error-exitcode=255 \
  264. --leak-check=no \
  265. --track-origins=yes \
  266. --suppressions=./dpf/utils/valgrind-dpf.supp \
  267. ./bin/Ildaeil-FX selftest
  268. - name: Validate LV2 ttl syntax
  269. run: |
  270. lv2_validate \
  271. /usr/lib/lv2/mod.lv2/*.ttl \
  272. /usr/lib/lv2/kx-meta/*.ttl \
  273. /usr/lib/lv2/kx-control-input-port-change-request.lv2/*.ttl \
  274. /usr/lib/lv2/kx-programs.lv2/*.ttl \
  275. ./bin/*.lv2/*.ttl
  276. - name: Validate LV2 metadata and binaries
  277. run: |
  278. export LV2_PATH=/tmp/lv2-path
  279. mkdir ${LV2_PATH}
  280. cp -r bin/*.lv2 \
  281. /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 \
  282. ${LV2_PATH}
  283. lv2lint -s lv2_generate_ttl -l ld-linux-x86-64.so.2 -M nopack $(lv2ls)
  284. - name: Test LV2 plugins
  285. run: |
  286. export LV2_PATH=/tmp/lv2-path
  287. for p in $(lv2ls); do \
  288. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  289. valgrind \
  290. --error-exitcode=255 \
  291. --leak-check=full \
  292. --track-origins=yes \
  293. --suppressions=./dpf/utils/valgrind-dpf.supp \
  294. /usr/lib/carla/carla-bridge-native lv2 "" ${p} 1>/dev/null; \
  295. done
  296. - name: Test VST2 plugins
  297. run: |
  298. for p in $(find bin/ | grep -e vst.so -e '.*\.vst/.*\.so'); do \
  299. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  300. valgrind \
  301. --error-exitcode=255 \
  302. --leak-check=full \
  303. --track-origins=yes \
  304. --suppressions=./dpf/utils/valgrind-dpf.supp \
  305. /usr/lib/carla/carla-bridge-native vst2 ./${p} "" 1>/dev/null; \
  306. done
  307. - name: Test VST3 plugins
  308. run: |
  309. for p in $(ls bin/ | grep vst3); do \
  310. env CARLA_BRIDGE_DUMMY=1 CARLA_BRIDGE_TESTING=native \
  311. valgrind \
  312. --error-exitcode=255 \
  313. --leak-check=full \
  314. --track-origins=yes \
  315. --suppressions=./dpf/utils/valgrind-dpf.supp \
  316. /usr/lib/carla/carla-bridge-native vst3 ./bin/${p} "" 1>/dev/null; \
  317. done