verify.yml 7.3 KB

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