verify.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. # SPDX-FileCopyrightText: 2022 suyu Emulator Project
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. name: 'suyu verify'
  4. on:
  5. pull_request:
  6. branches: [ master ]
  7. env:
  8. PR_NUMBER: pr${{ github.event.number }}
  9. jobs:
  10. format:
  11. name: 'verify format'
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v3
  15. with:
  16. submodules: false
  17. - name: set up JDK 17
  18. uses: actions/setup-java@v3
  19. with:
  20. java-version: '17'
  21. distribution: 'temurin'
  22. - name: 'Verify Formatting'
  23. run: bash -ex ./.ci/scripts/format/script.sh
  24. build:
  25. name: 'test build'
  26. needs: format
  27. runs-on: ubuntu-latest
  28. strategy:
  29. fail-fast: false
  30. matrix:
  31. include:
  32. - type: clang
  33. image: linux-fresh
  34. - type: linux
  35. image: linux-fresh
  36. - type: windows
  37. image: linux-mingw
  38. container:
  39. image: suyuemu/build-environments:${{ matrix.image }}
  40. options: -u 1001
  41. steps:
  42. - uses: actions/checkout@v3
  43. with:
  44. submodules: recursive
  45. fetch-depth: 0
  46. - name: Set up cache
  47. uses: actions/cache@v3
  48. id: ccache-restore
  49. with:
  50. path: ~/.ccache
  51. key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }}
  52. restore-keys: |
  53. ${{ runner.os }}-${{ matrix.type }}-
  54. - name: Create ccache directory
  55. if: steps.ccache-restore.outputs.cache-hit != 'true'
  56. run: mkdir -p ~/.ccache
  57. - name: Build
  58. run: ./.ci/scripts/${{ matrix.type }}/docker.sh
  59. env:
  60. ENABLE_COMPATIBILITY_REPORTING: "ON"
  61. - name: Pack
  62. run: ./.ci/scripts/${{ matrix.type }}/upload.sh
  63. env:
  64. NO_SOURCE_PACK: "YES"
  65. - name: Upload
  66. uses: actions/upload-artifact@v3
  67. with:
  68. name: ${{ matrix.type }}
  69. path: artifacts/
  70. build-mac:
  71. name: 'test build (macos)'
  72. needs: format
  73. runs-on: macos-14
  74. steps:
  75. - uses: actions/checkout@v3
  76. with:
  77. submodules: recursive
  78. fetch-depth: 0
  79. - name: Install dependencies
  80. run: |
  81. brew install autoconf automake boost ccache ffmpeg fmt glslang hidapi libtool libusb lz4 ninja nlohmann-json openssl pkg-config qt@5 sdl2 speexdsp zlib zlib zstd
  82. - name: Build
  83. run: |
  84. mkdir build
  85. cd build
  86. export Qt5_DIR="$(brew --prefix qt@5)/lib/cmake"
  87. cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dsuyu_USE_BUNDLED_VCPKG=OFF -Dsuyu_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
  88. ninja
  89. build-msvc:
  90. name: 'test build (windows, msvc)'
  91. needs: format
  92. runs-on: windows-2022
  93. steps:
  94. - uses: actions/checkout@v3
  95. with:
  96. submodules: recursive
  97. fetch-depth: 0
  98. - name: Set up cache
  99. uses: actions/cache@v3
  100. with:
  101. path: ~/.buildcache
  102. key: ${{ runner.os }}-msvc-${{ github.sha }}
  103. restore-keys: |
  104. ${{ runner.os }}-msvc-
  105. - name: Install dependencies
  106. shell: pwsh
  107. run: |
  108. $ErrorActionPreference = "Stop"
  109. $BuildCacheVer = "v0.28.4"
  110. $File = "buildcache-windows.zip"
  111. $Uri = "https://github.com/mbitsnbites/buildcache/releases/download/$BuildCacheVer/$File"
  112. $WebClient = New-Object System.Net.WebClient
  113. $WebClient.DownloadFile($Uri, $File)
  114. 7z x $File
  115. $CurrentDir = Convert-Path .
  116. echo "$CurrentDir/buildcache/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  117. - name: Install Vulkan SDK
  118. shell: pwsh
  119. run: .\.ci\scripts\windows\install-vulkan-sdk.ps1
  120. - name: Set up MSVC
  121. uses: ilammy/msvc-dev-cmd@v1
  122. - name: Configure
  123. env:
  124. CC: cl.exe
  125. CXX: cl.exe
  126. run: |
  127. glslangValidator --version
  128. mkdir build
  129. cmake . -B build -GNinja -DCMAKE_TOOLCHAIN_FILE="CMakeModules/MSVCCache.cmake" -DUSE_CCACHE=ON -Dsuyu_USE_BUNDLED_QT=1 -Dsuyu_USE_BUNDLED_SDL2=1 -Dsuyu_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -Dsuyu_ENABLE_COMPATIBILITY_REPORTING=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DCMAKE_BUILD_TYPE=Release -DGIT_BRANCH=pr-verify -Dsuyu_CRASH_DUMPS=ON
  130. - name: Build
  131. run: cmake --build build
  132. - name: Cache Summary
  133. run: buildcache -s
  134. - name: Pack
  135. shell: pwsh
  136. run: .\.ci\scripts\windows\upload.ps1
  137. - name: Upload
  138. uses: actions/upload-artifact@v3
  139. with:
  140. name: msvc
  141. path: artifacts/
  142. - name: Upload EXE
  143. uses: actions/upload-artifact@v3
  144. with:
  145. name: ${{ env.INDIVIDUAL_EXE }}
  146. path: ${{ env.INDIVIDUAL_EXE }}
  147. android:
  148. runs-on: ubuntu-latest
  149. needs: format
  150. steps:
  151. - uses: actions/checkout@v3
  152. with:
  153. submodules: recursive
  154. fetch-depth: 0
  155. - name: set up JDK 17
  156. uses: actions/setup-java@v3
  157. with:
  158. java-version: '17'
  159. distribution: 'temurin'
  160. - name: Set up cache
  161. uses: actions/cache@v3
  162. with:
  163. path: |
  164. ~/.gradle/caches
  165. ~/.gradle/wrapper
  166. ~/.ccache
  167. key: ${{ runner.os }}-android-${{ github.sha }}
  168. restore-keys: |
  169. ${{ runner.os }}-android-
  170. - name: Query tag name
  171. uses: olegtarasov/get-tag@v2.1.2
  172. id: tagName
  173. - name: Install dependencies
  174. run: |
  175. sudo apt-get update
  176. sudo apt-get install -y ccache apksigner glslang-dev glslang-tools
  177. - name: Build
  178. run: ./.ci/scripts/android/build.sh
  179. - name: Copy and sign artifacts
  180. env:
  181. ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
  182. ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
  183. ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}
  184. run: ./.ci/scripts/android/upload.sh
  185. - name: Upload
  186. uses: actions/upload-artifact@v3
  187. with:
  188. name: android
  189. path: artifacts/