verify.yml 5.2 KB

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