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.

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