cmake.yml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. name: CMake
  2. on:
  3. push:
  4. branches: [ development ]
  5. pull_request:
  6. branches: [ development ]
  7. env:
  8. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  9. BUILD_TYPE: Release
  10. jobs:
  11. build:
  12. if: github.repository == 'TorqueGameEngines/Torque3D'
  13. # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
  14. # You can convert this to a matrix build if you need cross-platform coverage.
  15. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  16. runs-on: ${{matrix.os}}
  17. strategy:
  18. matrix:
  19. os: [ ubuntu-latest, macos-latest, windows-latest ]
  20. steps:
  21. - uses: actions/checkout@v3
  22. - uses: seanmiddleditch/gha-setup-ninja@master
  23. - uses: ilammy/msvc-dev-cmd@v1
  24. - name: Setup Environment
  25. run: |
  26. if [ "$RUNNER_OS" == "Linux" ]; then
  27. sudo apt-get update && \
  28. sudo apt-get install -y \
  29. build-essential \
  30. nasm \
  31. libogg-dev \
  32. libxft-dev \
  33. libx11-dev \
  34. libxxf86vm-dev \
  35. libopenal-dev \
  36. libfreetype6-dev \
  37. libxcursor-dev \
  38. libxinerama-dev \
  39. libxi-dev \
  40. libxrandr-dev \
  41. libxss-dev \
  42. libglu1-mesa-dev \
  43. libgtk-3-dev
  44. fi
  45. shell: bash
  46. - name: Configure CMake
  47. # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
  48. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
  49. run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTORQUE_APP_NAME=Torque3D -DTORQUE_TESTING=ON
  50. - name: Build
  51. # Build your program with the given configuration
  52. run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
  53. - name: Test
  54. run: |
  55. cd "${{github.workspace}}/My Projects/Torque3D/game"
  56. if [ "$RUNNER_OS" == "macOS" ]; then
  57. ./Torque3D.app/Contents/MacOS/Torque3D runTests.tscript
  58. else
  59. ./Torque3D runTests.tscript
  60. fi
  61. shell: bash
  62. # Make all paths conform to the Unix runner setup:
  63. - name: Replace Absolute Paths In Test Report
  64. run: |
  65. import os
  66. dir = os.environ["WorkspaceDirectory"]
  67. filePath = dir + "/My Projects/Torque3D/game/test_detail.xml"
  68. f = open(filePath, 'r')
  69. filedata = f.read()
  70. f.close()
  71. filedata = filedata.replace(dir, "/home/runner/work/Torque3D/Torque3D").replace("\\", "/")
  72. f = open(filePath, 'w')
  73. f.write(filedata)
  74. f.close()
  75. shell: python
  76. env:
  77. WorkspaceDirectory: ${{github.workspace}}
  78. - name: Upload Test Report
  79. uses: actions/upload-artifact@v3
  80. if: always() # always run even if the previous step fails
  81. with:
  82. name: junit-test-results-${{ runner.os }}
  83. path: '**/My Projects/Torque3D/game/test_detail.xml'
  84. retention-days: 1