verify.yml 6.8 KB

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