verify.yml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. 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
  80. - name: Build
  81. run: |
  82. mkdir build
  83. cd build
  84. export Qt5_DIR="/usr/local/opt/qt@5/lib/cmake"
  85. cmake .. -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_TESTS=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_LIBUSB=OFF
  86. ninja
  87. build-msvc:
  88. name: 'test build (windows, msvc)'
  89. needs: format
  90. runs-on: windows-2022
  91. steps:
  92. - uses: actions/checkout@v3
  93. with:
  94. submodules: recursive
  95. fetch-depth: 0
  96. - name: Set up cache
  97. uses: actions/cache@v3
  98. with:
  99. path: ~/.buildcache
  100. key: ${{ runner.os }}-msvc-${{ github.sha }}
  101. restore-keys: |
  102. ${{ runner.os }}-msvc-
  103. - name: Install dependencies
  104. shell: pwsh
  105. run: |
  106. $ErrorActionPreference = "Stop"
  107. $BuildCacheVer = "v0.28.4"
  108. $File = "buildcache-windows.zip"
  109. $Uri = "https://github.com/mbitsnbites/buildcache/releases/download/$BuildCacheVer/$File"
  110. $WebClient = New-Object System.Net.WebClient
  111. $WebClient.DownloadFile($Uri, $File)
  112. 7z x $File
  113. $CurrentDir = Convert-Path .
  114. echo "$CurrentDir/buildcache/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  115. - name: Install Vulkan SDK
  116. shell: pwsh
  117. run: .\.ci\scripts\windows\install-vulkan-sdk.ps1
  118. - name: Set up MSVC
  119. uses: ilammy/msvc-dev-cmd@v1
  120. - name: Configure
  121. env:
  122. CC: cl.exe
  123. CXX: cl.exe
  124. run: |
  125. glslangValidator --version
  126. mkdir build
  127. 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
  128. - name: Build
  129. run: cmake --build build
  130. - name: Cache Summary
  131. run: buildcache -s
  132. - name: Pack
  133. shell: pwsh
  134. run: .\.ci\scripts\windows\upload.ps1
  135. - name: Upload
  136. uses: actions/upload-artifact@v3
  137. with:
  138. name: msvc
  139. path: artifacts/
  140. - name: Upload EXE
  141. uses: actions/upload-artifact@v3
  142. with:
  143. name: ${{ env.INDIVIDUAL_EXE }}
  144. path: ${{ env.INDIVIDUAL_EXE }}
  145. android:
  146. runs-on: ubuntu-latest
  147. needs: format
  148. steps:
  149. - uses: actions/checkout@v3
  150. with:
  151. submodules: recursive
  152. fetch-depth: 0
  153. - name: set up JDK 17
  154. uses: actions/setup-java@v3
  155. with:
  156. java-version: '17'
  157. distribution: 'temurin'
  158. - name: Set up cache
  159. uses: actions/cache@v3
  160. with:
  161. path: |
  162. ~/.gradle/caches
  163. ~/.gradle/wrapper
  164. ~/.ccache
  165. key: ${{ runner.os }}-android-${{ github.sha }}
  166. restore-keys: |
  167. ${{ runner.os }}-android-
  168. - name: Query tag name
  169. uses: olegtarasov/get-tag@v2.1.2
  170. id: tagName
  171. - name: Install dependencies
  172. run: |
  173. sudo apt-get update
  174. sudo apt-get install -y ccache apksigner glslang-dev glslang-tools
  175. - name: Build
  176. run: ./.ci/scripts/android/build.sh
  177. - name: Copy and sign artifacts
  178. env:
  179. ANDROID_KEYSTORE_B64: ${{ secrets.ANDROID_KEYSTORE_B64 }}
  180. ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
  181. ANDROID_KEYSTORE_PASS: ${{ secrets.ANDROID_KEYSTORE_PASS }}
  182. run: ./.ci/scripts/android/upload.sh
  183. - name: Upload
  184. uses: actions/upload-artifact@v3
  185. with:
  186. name: android
  187. path: artifacts/