verify.yml 6.8 KB

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