verify.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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-2019
  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 vulkan-sdk 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: Set up MSVC
  92. uses: ilammy/msvc-dev-cmd@v1
  93. - uses: actions/checkout@v3
  94. with:
  95. submodules: recursive
  96. fetch-depth: 0
  97. - name: Configure
  98. env:
  99. CC: cl.exe
  100. CXX: cl.exe
  101. run: |
  102. glslangValidator --version
  103. mkdir build
  104. 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 -DCLANG_FORMAT_SUFFIX=discordplzdontclang -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_VCPKG=ON
  105. - name: Build
  106. run: cmake --build build
  107. - name: Cache Summary
  108. run: buildcache -s
  109. - name: Pack
  110. shell: pwsh
  111. run: .\.ci\scripts\windows\upload.ps1
  112. - name: Upload
  113. uses: actions/upload-artifact@v3
  114. with:
  115. name: msvc
  116. path: artifacts/
  117. - name: Upload EXE
  118. uses: actions/upload-artifact@v3
  119. with:
  120. name: ${{ env.INDIVIDUAL_EXE }}
  121. path: ${{ env.INDIVIDUAL_EXE }}