verify.yml 6.7 KB

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