verify.yml 6.9 KB

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