linux-arm64.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. # LYNX SHARE for Linux on arm64 (aarch64: Raspberry Pi 4/5 with a 64-bit OS, Ubuntu / Debian / Fedora arm64, Asahi
  2. # Linux...), round 190oy. Built natively on GitHub's arm64 runners (ubuntu-24.04-arm: free for public repositories).
  3. #
  4. # version the package label (input, or CMakeLists.txt's version + the commit)
  5. # package (ubuntu-24.04-arm, Ubuntu 22.04 container, glibc 2.35) the same steps as release.yml's x86_64 Linux job:
  6. # CMake + GCC 13, glibc check, self-test, open test, demo project, LYNX-<label>-aarch64.AppImage (+ .zsync)
  7. # and LYNX-<label>-linux-aarch64.tar.gz (scripts/package-linux.sh, ARCH=aarch64), the AppImage start checks
  8. # core (ubuntu-24.04-arm) the core test suite (scripts/build-local.sh) with clang++, as tests.yml's Core jobs, and
  9. # core-release-gcc with the release's GCC 13.4 (toolchain PPA) in the Ubuntu 22.04 container
  10. # perf (ubuntu-24.04-arm and ubuntu-24.04) tools/perfbench on the same scenarios on both runners: arm64 against
  11. # x86_64 on GitHub's hosted machines (4 vCPUs each)
  12. #
  13. # release.yml calls it (workflow_call: the package job only) and attaches the arm64 packages to the release. A push to a
  14. # ci-arm64/** branch or a manual run (workflow_dispatch) runs every job.
  15. name: Linux arm64
  16. on:
  17. push:
  18. branches: ['ci-arm64/**']
  19. workflow_dispatch:
  20. workflow_call:
  21. inputs:
  22. label:
  23. description: 'package label (release.yml passes its own)'
  24. type: string
  25. default: ''
  26. permissions:
  27. contents: read
  28. env:
  29. JUCE_VERSION: 8.0.4
  30. JUCE_SHA256: 0effe9823a6fd8a4f98e5c08be7d308350e417b2d15dcf34011e778fefbbf005
  31. jobs:
  32. version:
  33. name: Version
  34. runs-on: ubuntu-24.04
  35. outputs:
  36. label: ${{ steps.version.outputs.label }}
  37. steps:
  38. - uses: actions/checkout@v5
  39. - name: Label
  40. id: version
  41. shell: bash
  42. env:
  43. INPUT_LABEL: ${{ inputs.label }}
  44. run: |
  45. version="$(sed -n 's/^project(LYNX VERSION \([0-9]*\.[0-9]*\.[0-9]*\(\.[0-9]*\)\{0,1\}\).*/\1/p' CMakeLists.txt)"
  46. [[ -n "$version" ]] || { echo "::error::no version in CMakeLists.txt"; exit 1; }
  47. label="${INPUT_LABEL:-$version-${GITHUB_SHA::7}}"
  48. echo "label=$label" >> "$GITHUB_OUTPUT"
  49. echo "LYNX arm64 $label"
  50. package:
  51. name: Linux arm64 (AppImage, tar.gz)
  52. needs: version
  53. runs-on: ubuntu-24.04-arm
  54. timeout-minutes: 180
  55. container:
  56. image: ubuntu:22.04
  57. options: --cap-add=SYS_ADMIN # lets check-appimage-start.sh run the AppImage in a network namespace (offline)
  58. env:
  59. LABEL: ${{ needs.version.outputs.label }}
  60. DEBIAN_FRONTEND: noninteractive
  61. MAX_GLIBC: '2.35'
  62. ARCH: aarch64
  63. steps:
  64. - name: Build dependencies (Ubuntu 22.04 + GCC 13 from ppa:ubuntu-toolchain-r/test)
  65. run: |
  66. uname -m
  67. # (round 190qd) Launchpad's PPA answered 503 on half the requests during the 0.1.31 release: apt retries
  68. echo 'Acquire::Retries "30";' > /etc/apt/apt.conf.d/80-lynx-retries
  69. apt-get update -q
  70. apt-get install -y -q --no-install-recommends ca-certificates curl git gnupg software-properties-common
  71. add-apt-repository -y ppa:ubuntu-toolchain-r/test
  72. apt-get update -q
  73. apt-get install -y -q gcc-13 g++-13 cmake ninja-build pkg-config file binutils xvfb xauth x11-utils python3 \
  74. fonts-dejavu-core libasound2-dev libjack-jackd2-dev libx11-dev libxrandr-dev libxinerama-dev \
  75. libxcursor-dev libxext-dev libxcomposite-dev libfreetype-dev libfontconfig1-dev libgl-dev desktop-file-utils zsync
  76. ldd --version | head -1
  77. g++-13 --version | head -1
  78. - uses: actions/checkout@v5
  79. - name: JUCE (checksum verified)
  80. run: |
  81. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  82. curl -fsSL -o juce.tar.gz "https://github.com/juce-framework/JUCE/archive/refs/tags/$JUCE_VERSION.tar.gz"
  83. echo "$JUCE_SHA256 juce.tar.gz" | sha256sum -c -
  84. mkdir -p "$RUNNER_TEMP/juce" && tar xzf juce.tar.gz -C "$RUNNER_TEMP/juce" --strip-components 1 && rm juce.tar.gz
  85. # (-j3: the runner has 4 cores and 16 GB; Main.cpp and the LTO link need several GB each)
  86. - name: Build
  87. run: |
  88. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DFETCHCONTENT_SOURCE_DIR_JUCE="$RUNNER_TEMP/juce" \
  89. -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
  90. cmake --build build --target LYNX -- -k 0 -j3
  91. file build/LYNX_artefacts/Release/LYNX
  92. sha256sum build/LYNX_artefacts/Release/LYNX
  93. - name: Runs on glibc ${{ env.MAX_GLIBC }} without the system's libstdc++
  94. run: ./scripts/check-linux-compat.sh build/LYNX_artefacts/Release/LYNX "$MAX_GLIBC"
  95. - name: Self-test and demo project
  96. run: |
  97. bin=build/LYNX_artefacts/Release/LYNX
  98. xvfb-run -a "$bin" --selftest "$PWD/selftest.txt" "$PWD/selftest-demo.lynx" || true
  99. cat selftest.txt
  100. grep -q '^result=OK' selftest.txt
  101. xvfb-run -a "$bin" --opentest "$PWD/opentest.txt" || true
  102. tail -3 opentest.txt; grep -E 'FAIL|HANG' opentest.txt || true
  103. grep -q '^result=OK' opentest.txt
  104. xvfb-run -a "$bin" --showcase "$PWD/Demo.lynx" || true
  105. test -s Demo.lynx
  106. - name: Package
  107. run: ./scripts/package-linux.sh build/LYNX_artefacts/Release/LYNX "$LABEL" dist Demo.lynx
  108. - name: AppImage starts offline and shows its window
  109. run: REQUIRE_OFFLINE=1 ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-aarch64.AppImage" 20
  110. - name: AppImage starts on a system without fonts
  111. run: FONTS=none ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-aarch64.AppImage" 20
  112. - name: Upload package
  113. uses: actions/upload-artifact@v7
  114. with:
  115. name: LYNX-${{ env.LABEL }}-linux-aarch64
  116. path: dist/*
  117. if-no-files-found: error
  118. - name: Upload the self-test reports
  119. if: always()
  120. uses: actions/upload-artifact@v7
  121. with:
  122. name: arm64-selftest-${{ env.LABEL }}
  123. path: |
  124. selftest.txt
  125. opentest.txt
  126. opentest-hang/*
  127. retention-days: 14
  128. if-no-files-found: ignore
  129. core:
  130. name: Core (ubuntu-24.04-arm, ${{ matrix.compiler }})
  131. if: ${{ !inputs.label }} # (not when release.yml calls it)
  132. runs-on: ubuntu-24.04-arm
  133. timeout-minutes: 240
  134. # (clang++ only: Ubuntu 24.04's own g++ 13.3 fails 5 checks of 7.6 million on arm64 (range-for loops over
  135. # braced lists of enum values) that GCC 13.4, the release's compiler (job below), and clang pass: a GCC 13.3 code
  136. # generation fault, round 190oy)
  137. strategy:
  138. fail-fast: false
  139. matrix:
  140. compiler: [clang++]
  141. env:
  142. CCACHE_DIR: ${{ github.workspace }}/.ccache
  143. CCACHE_MAXSIZE: 1500M
  144. CCACHE_COMPILERCHECK: content
  145. steps:
  146. - uses: actions/checkout@v5
  147. - name: ccache
  148. run: for i in 1 2 3 4 5 6; do sudo apt-get update -q && sudo apt-get install -y -q ccache && break; [ $i = 6 ] && exit 1; sleep 30; done
  149. - uses: actions/cache/restore@v4
  150. with:
  151. path: .ccache
  152. key: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-${{ github.sha }}
  153. restore-keys: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-
  154. - name: Build and test the core (no JUCE)
  155. env:
  156. CXX: ccache ${{ matrix.compiler }}
  157. LYNX_TEST_JOBS: auto
  158. run: |
  159. uname -m; ${{ matrix.compiler }} --version | head -1
  160. ccache --zero-stats > /dev/null
  161. ./scripts/build-local.sh
  162. - uses: actions/cache/save@v4
  163. if: always()
  164. with:
  165. path: .ccache
  166. key: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-${{ github.sha }}
  167. - name: Upload the test logs
  168. if: always()
  169. uses: actions/upload-artifact@v7
  170. with:
  171. name: core-test-logs-ubuntu-24.04-arm-${{ matrix.compiler }}
  172. path: build-local/lynx_tests.shards
  173. retention-days: 14
  174. if-no-files-found: ignore
  175. # the release's compiler: GCC 13.4 from the toolchain PPA in the package job's Ubuntu 22.04 container
  176. core-release-gcc:
  177. name: Core (arm64, Ubuntu 22.04, GCC 13 PPA)
  178. if: ${{ !inputs.label }}
  179. runs-on: ubuntu-24.04-arm
  180. timeout-minutes: 240
  181. container:
  182. image: ubuntu:22.04
  183. env:
  184. DEBIAN_FRONTEND: noninteractive
  185. steps:
  186. - name: GCC 13 (ppa:ubuntu-toolchain-r/test)
  187. run: |
  188. # (round 190qd) Launchpad's PPA answered 503 on half the requests during the 0.1.31 release: apt retries
  189. echo 'Acquire::Retries "30";' > /etc/apt/apt.conf.d/80-lynx-retries
  190. apt-get update -q
  191. apt-get install -y -q --no-install-recommends ca-certificates curl git gnupg software-properties-common python3
  192. add-apt-repository -y ppa:ubuntu-toolchain-r/test
  193. apt-get update -q
  194. apt-get install -y -q gcc-13 g++-13
  195. g++-13 --version | head -1
  196. - uses: actions/checkout@v5
  197. - name: Build and test the core (no JUCE)
  198. env:
  199. CXX: g++-13
  200. LYNX_TEST_JOBS: auto
  201. run: ./scripts/build-local.sh
  202. - name: Upload the test logs
  203. if: always()
  204. uses: actions/upload-artifact@v7
  205. with:
  206. name: core-test-logs-arm64-gcc13-ppa
  207. path: build-local/lynx_tests.shards
  208. retention-days: 14
  209. if-no-files-found: ignore
  210. perf:
  211. name: perfbench (${{ matrix.os }})
  212. if: ${{ !inputs.label }} # (not when release.yml calls it)
  213. runs-on: ${{ matrix.os }}
  214. timeout-minutes: 90
  215. strategy:
  216. fail-fast: false
  217. matrix:
  218. os: [ubuntu-24.04-arm, ubuntu-24.04]
  219. steps:
  220. - uses: actions/checkout@v5
  221. - name: Build tools/perfbench (Release, no JUCE)
  222. run: |
  223. for i in 1 2 3 4 5 6; do sudo apt-get update -q && sudo apt-get install -y -q ninja-build && break; [ $i = 6 ] && exit 1; sleep 30; done
  224. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLYNX_BUILD_APP=OFF -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
  225. cmake --build build --target perfbench
  226. - name: Scenarios
  227. run: |
  228. uname -m; nproc; grep -m1 -E 'model name|CPU part' /proc/cpuinfo || true; lscpu | grep -E 'Model name|Vendor' || true
  229. sudo sysctl -w kernel.perf_event_paranoid=1 > /dev/null 2>&1 || true
  230. mkdir -p perf
  231. for s in calibrate demo synth100 inserts50 stream automation big200 idle; do
  232. echo "=== $s"
  233. build/perfbench "$s" --reps 3 --gate 2>&1 | tee "perf/$s.txt" | tail -6
  234. done
  235. for b in 64 256; do
  236. echo "=== synth100 --block $b"
  237. build/perfbench synth100 --block "$b" --reps 3 --gate 2>&1 | tee "perf/synth100-b$b.txt" | tail -4
  238. done
  239. echo "=== synth100 --threads 3"
  240. build/perfbench synth100 --threads 3 --reps 3 --gate 2>&1 | tee perf/synth100-t3.txt | tail -4
  241. grep -h '^GATE' perf/*.txt > perf/gate-lines.txt || true
  242. - name: Upload the results
  243. if: always()
  244. uses: actions/upload-artifact@v7
  245. with:
  246. name: perfbench-${{ matrix.os }}
  247. path: perf/*
  248. retention-days: 30
  249. if-no-files-found: ignore