verify.yml 7.3 KB

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