verify.yml 5.3 KB

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