verify.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. name: 'yuzu verify'
  2. on:
  3. pull_request:
  4. branches: [ master ]
  5. env:
  6. PR_NUMBER: pr${{ github.event.number }}
  7. jobs:
  8. format:
  9. name: 'verify format'
  10. runs-on: ubuntu-latest
  11. container:
  12. image: yuzuemu/build-environments:linux-clang-format
  13. options: -u 1001
  14. steps:
  15. - uses: actions/checkout@v3
  16. with:
  17. submodules: false
  18. - name: 'Verify Formatting'
  19. run: bash -ex ./.ci/scripts/format/script.sh
  20. build:
  21. name: 'test build'
  22. needs: format
  23. runs-on: ubuntu-latest
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - type: clang
  29. image: linux-fresh
  30. - type: linux
  31. image: linux-fresh
  32. - type: windows
  33. image: linux-mingw
  34. container:
  35. image: yuzuemu/build-environments:${{ matrix.image }}
  36. options: -u 1001
  37. steps:
  38. - uses: actions/checkout@v3
  39. with:
  40. submodules: recursive
  41. fetch-depth: 0
  42. - name: Set up cache
  43. uses: actions/cache@v3
  44. id: ccache-restore
  45. with:
  46. path: ~/.ccache
  47. key: ${{ runner.os }}-${{ matrix.type }}-${{ github.sha }}
  48. restore-keys: |
  49. ${{ runner.os }}-${{ matrix.type }}-
  50. - name: Create ccache directory
  51. if: steps.ccache-restore.outputs.cache-hit != 'true'
  52. run: mkdir -p ~/.ccache
  53. - name: Build
  54. run: ./.ci/scripts/${{ matrix.type }}/docker.sh
  55. env:
  56. ENABLE_COMPATIBILITY_REPORTING: "ON"
  57. - name: Pack
  58. run: ./.ci/scripts/${{ matrix.type }}/upload.sh
  59. env:
  60. NO_SOURCE_PACK: "YES"
  61. - name: Upload
  62. uses: actions/upload-artifact@v3
  63. with:
  64. name: ${{ matrix.type }}
  65. path: artifacts/
  66. build-msvc:
  67. name: 'test build (windows, msvc)'
  68. needs: format
  69. runs-on: windows-2019
  70. steps:
  71. - name: Set up cache
  72. uses: actions/cache@v3
  73. with:
  74. path: ~/.buildcache
  75. key: ${{ runner.os }}-msvc-${{ github.sha }}
  76. restore-keys: |
  77. ${{ runner.os }}-msvc-
  78. - name: Install dependencies
  79. # due to how chocolatey works, only cmd.exe is supported here
  80. shell: cmd
  81. run: |
  82. choco install vulkan-sdk wget
  83. call refreshenv
  84. wget https://github.com/mbitsnbites/buildcache/releases/download/v0.27.6/buildcache-windows.zip
  85. 7z x buildcache-windows.zip
  86. copy buildcache\bin\buildcache.exe C:\ProgramData\chocolatey\bin
  87. rmdir buildcache
  88. echo %PATH% >> %GITHUB_PATH%
  89. - name: Set up MSVC
  90. uses: ilammy/msvc-dev-cmd@v1
  91. - uses: actions/checkout@v3
  92. with:
  93. submodules: recursive
  94. fetch-depth: 0
  95. - name: Configure
  96. env:
  97. CC: cl.exe
  98. CXX: cl.exe
  99. run: |
  100. glslangValidator --version
  101. mkdir build
  102. 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
  103. - name: Build
  104. run: cmake --build build
  105. - name: Cache Summary
  106. run: buildcache -s
  107. - name: Pack
  108. shell: pwsh
  109. run: .\.ci\scripts\windows\upload.ps1
  110. - name: Upload
  111. uses: actions/upload-artifact@v3
  112. with:
  113. name: msvc
  114. path: artifacts/
  115. - name: Upload EXE
  116. uses: actions/upload-artifact@v3
  117. with:
  118. name: ${{ env.INDIVIDUAL_EXE }}
  119. path: ${{ env.INDIVIDUAL_EXE }}