verify.yml 6.1 KB

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