linux-arm64.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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]*\).*/\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. apt-get update -q
  68. apt-get install -y -q --no-install-recommends ca-certificates curl git gnupg software-properties-common
  69. add-apt-repository -y ppa:ubuntu-toolchain-r/test
  70. apt-get update -q
  71. apt-get install -y -q gcc-13 g++-13 cmake ninja-build pkg-config file binutils xvfb xauth x11-utils python3 \
  72. fonts-dejavu-core libasound2-dev libjack-jackd2-dev libx11-dev libxrandr-dev libxinerama-dev \
  73. libxcursor-dev libxext-dev libxcomposite-dev libfreetype-dev libfontconfig1-dev libgl-dev desktop-file-utils zsync
  74. ldd --version | head -1
  75. g++-13 --version | head -1
  76. - uses: actions/checkout@v5
  77. - name: JUCE (checksum verified)
  78. run: |
  79. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  80. curl -fsSL -o juce.tar.gz "https://github.com/juce-framework/JUCE/archive/refs/tags/$JUCE_VERSION.tar.gz"
  81. echo "$JUCE_SHA256 juce.tar.gz" | sha256sum -c -
  82. mkdir -p "$RUNNER_TEMP/juce" && tar xzf juce.tar.gz -C "$RUNNER_TEMP/juce" --strip-components 1 && rm juce.tar.gz
  83. # (-j3: the runner has 4 cores and 16 GB; Main.cpp and the LTO link need several GB each)
  84. - name: Build
  85. run: |
  86. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DFETCHCONTENT_SOURCE_DIR_JUCE="$RUNNER_TEMP/juce" \
  87. -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
  88. cmake --build build --target LYNX -- -k 0 -j3
  89. file build/LYNX_artefacts/Release/LYNX
  90. sha256sum build/LYNX_artefacts/Release/LYNX
  91. - name: Runs on glibc ${{ env.MAX_GLIBC }} without the system's libstdc++
  92. run: ./scripts/check-linux-compat.sh build/LYNX_artefacts/Release/LYNX "$MAX_GLIBC"
  93. - name: Self-test and demo project
  94. run: |
  95. bin=build/LYNX_artefacts/Release/LYNX
  96. xvfb-run -a "$bin" --selftest "$PWD/selftest.txt" "$PWD/selftest-demo.lynx" || true
  97. cat selftest.txt
  98. grep -q '^result=OK' selftest.txt
  99. xvfb-run -a "$bin" --opentest "$PWD/opentest.txt" || true
  100. tail -3 opentest.txt; grep -E 'FAIL|HANG' opentest.txt || true
  101. grep -q '^result=OK' opentest.txt
  102. xvfb-run -a "$bin" --showcase "$PWD/Demo.lynx" || true
  103. test -s Demo.lynx
  104. - name: Package
  105. run: ./scripts/package-linux.sh build/LYNX_artefacts/Release/LYNX "$LABEL" dist Demo.lynx
  106. - name: AppImage starts offline and shows its window
  107. run: REQUIRE_OFFLINE=1 ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-aarch64.AppImage" 20
  108. - name: AppImage starts on a system without fonts
  109. run: FONTS=none ./scripts/check-appimage-start.sh "dist/LYNX-$LABEL-aarch64.AppImage" 20
  110. - name: Upload package
  111. uses: actions/upload-artifact@v7
  112. with:
  113. name: LYNX-${{ env.LABEL }}-linux-aarch64
  114. path: dist/*
  115. if-no-files-found: error
  116. - name: Upload the self-test reports
  117. if: always()
  118. uses: actions/upload-artifact@v7
  119. with:
  120. name: arm64-selftest-${{ env.LABEL }}
  121. path: |
  122. selftest.txt
  123. opentest.txt
  124. opentest-hang/*
  125. retention-days: 14
  126. if-no-files-found: ignore
  127. core:
  128. name: Core (ubuntu-24.04-arm, ${{ matrix.compiler }})
  129. if: ${{ !inputs.label }} # (not when release.yml calls it)
  130. runs-on: ubuntu-24.04-arm
  131. timeout-minutes: 240
  132. # (clang++ only: Ubuntu 24.04's own g++ 13.3 fails 5 checks of 7.6 million on arm64 (range-for loops over
  133. # braced lists of enum values) that GCC 13.4, the release's compiler (job below), and clang pass: a GCC 13.3 code
  134. # generation fault, round 190oy)
  135. strategy:
  136. fail-fast: false
  137. matrix:
  138. compiler: [clang++]
  139. env:
  140. CCACHE_DIR: ${{ github.workspace }}/.ccache
  141. CCACHE_MAXSIZE: 1500M
  142. CCACHE_COMPILERCHECK: content
  143. steps:
  144. - uses: actions/checkout@v5
  145. - name: ccache
  146. 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
  147. - uses: actions/cache/restore@v4
  148. with:
  149. path: .ccache
  150. key: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-${{ github.sha }}
  151. restore-keys: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-
  152. - name: Build and test the core (no JUCE)
  153. env:
  154. CXX: ccache ${{ matrix.compiler }}
  155. LYNX_TEST_JOBS: auto
  156. run: |
  157. uname -m; ${{ matrix.compiler }} --version | head -1
  158. ccache --zero-stats > /dev/null
  159. ./scripts/build-local.sh
  160. - uses: actions/cache/save@v4
  161. if: always()
  162. with:
  163. path: .ccache
  164. key: ccache-core-ubuntu-24.04-arm-${{ matrix.compiler }}-${{ github.sha }}
  165. - name: Upload the test logs
  166. if: always()
  167. uses: actions/upload-artifact@v7
  168. with:
  169. name: core-test-logs-ubuntu-24.04-arm-${{ matrix.compiler }}
  170. path: build-local/lynx_tests.shards
  171. retention-days: 14
  172. if-no-files-found: ignore
  173. # the release's compiler: GCC 13.4 from the toolchain PPA in the package job's Ubuntu 22.04 container
  174. core-release-gcc:
  175. name: Core (arm64, Ubuntu 22.04, GCC 13 PPA)
  176. if: ${{ !inputs.label }}
  177. runs-on: ubuntu-24.04-arm
  178. timeout-minutes: 240
  179. container:
  180. image: ubuntu:22.04
  181. env:
  182. DEBIAN_FRONTEND: noninteractive
  183. steps:
  184. - name: GCC 13 (ppa:ubuntu-toolchain-r/test)
  185. run: |
  186. apt-get update -q
  187. apt-get install -y -q --no-install-recommends ca-certificates curl git gnupg software-properties-common python3
  188. add-apt-repository -y ppa:ubuntu-toolchain-r/test
  189. apt-get update -q
  190. apt-get install -y -q gcc-13 g++-13
  191. g++-13 --version | head -1
  192. - uses: actions/checkout@v5
  193. - name: Build and test the core (no JUCE)
  194. env:
  195. CXX: g++-13
  196. LYNX_TEST_JOBS: auto
  197. run: ./scripts/build-local.sh
  198. - name: Upload the test logs
  199. if: always()
  200. uses: actions/upload-artifact@v7
  201. with:
  202. name: core-test-logs-arm64-gcc13-ppa
  203. path: build-local/lynx_tests.shards
  204. retention-days: 14
  205. if-no-files-found: ignore
  206. perf:
  207. name: perfbench (${{ matrix.os }})
  208. if: ${{ !inputs.label }} # (not when release.yml calls it)
  209. runs-on: ${{ matrix.os }}
  210. timeout-minutes: 90
  211. strategy:
  212. fail-fast: false
  213. matrix:
  214. os: [ubuntu-24.04-arm, ubuntu-24.04]
  215. steps:
  216. - uses: actions/checkout@v5
  217. - name: Build tools/perfbench (Release, no JUCE)
  218. run: |
  219. 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
  220. cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DLYNX_BUILD_APP=OFF -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13
  221. cmake --build build --target perfbench
  222. - name: Scenarios
  223. run: |
  224. uname -m; nproc; grep -m1 -E 'model name|CPU part' /proc/cpuinfo || true; lscpu | grep -E 'Model name|Vendor' || true
  225. sudo sysctl -w kernel.perf_event_paranoid=1 > /dev/null 2>&1 || true
  226. mkdir -p perf
  227. for s in calibrate demo synth100 inserts50 stream automation big200 idle; do
  228. echo "=== $s"
  229. build/perfbench "$s" --reps 3 --gate 2>&1 | tee "perf/$s.txt" | tail -6
  230. done
  231. for b in 64 256; do
  232. echo "=== synth100 --block $b"
  233. build/perfbench synth100 --block "$b" --reps 3 --gate 2>&1 | tee "perf/synth100-b$b.txt" | tail -4
  234. done
  235. echo "=== synth100 --threads 3"
  236. build/perfbench synth100 --threads 3 --reps 3 --gate 2>&1 | tee perf/synth100-t3.txt | tail -4
  237. grep -h '^GATE' perf/*.txt > perf/gate-lines.txt || true
  238. - name: Upload the results
  239. if: always()
  240. uses: actions/upload-artifact@v7
  241. with:
  242. name: perfbench-${{ matrix.os }}
  243. path: perf/*
  244. retention-days: 30
  245. if-no-files-found: ignore