verify.yml 6.1 KB

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