verify.yml 7.2 KB

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