You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
4.1 KiB

3 years ago
3 years ago
  1. name: CMakeBuilds
  2. on:
  3. push:
  4. pull_request:
  5. env:
  6. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  7. BUILD_TYPE: Release
  8. jobs:
  9. build_windows:
  10. name: Windows Build
  11. # The CMake configure and build commands are platform agnostic and should work equally
  12. # well on Windows or Mac. You can convert this to a matrix build if you need
  13. # cross-platform coverage.
  14. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  15. runs-on: windows-latest
  16. steps:
  17. - uses: actions/checkout@v2
  18. - name: Create Build Environment
  19. # Some projects don't allow in-source building, so create a separate build directory
  20. # We'll use this as our working directory for all subsequent commands
  21. run: cmake -E make_directory ${{github.workspace}}/build
  22. - name: Configure CMake
  23. # Use a bash shell so we can use the same syntax for environment variable
  24. # access regardless of the host operating system
  25. shell: powershell
  26. working-directory: ${{github.workspace}}/build
  27. # Note the current convention is to use the -S and -B options here to specify source
  28. # and build directories, but this is only available with CMake 3.13 and higher.
  29. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
  30. run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE -DPLATFORM=Desktop
  31. - name: Build
  32. working-directory: ${{github.workspace}}/build
  33. shell: powershell
  34. # Execute the build. You can specify a specific target with "--target <NAME>"
  35. run: cmake --build . --config $env:BUILD_TYPE
  36. - name: Test
  37. working-directory: ${{github.workspace}}/build
  38. shell: powershell
  39. # Execute tests defined by the CMake configuration.
  40. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  41. run: ctest -C $env:BUILD_TYPE
  42. build_linux:
  43. name: Linux Build
  44. # The CMake configure and build commands are platform agnostic and should work equally
  45. # well on Windows or Mac. You can convert this to a matrix build if you need
  46. # cross-platform coverage.
  47. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
  48. runs-on: ubuntu-latest
  49. steps:
  50. - uses: actions/checkout@v2
  51. - name: Create Build Environment
  52. # Some projects don't allow in-source building, so create a separate build directory
  53. # We'll use this as our working directory for all subsequent commands
  54. run: cmake -E make_directory ${{github.workspace}}/build
  55. - name: Setup Environment
  56. run: |
  57. sudo apt-get update -qq
  58. sudo apt-get install gcc-multilib
  59. sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
  60. - name: Configure CMake
  61. # Use a bash shell so we can use the same syntax for environment variable
  62. # access regardless of the host operating system
  63. shell: bash
  64. working-directory: ${{github.workspace}}/build
  65. # Note the current convention is to use the -S and -B options here to specify source
  66. # and build directories, but this is only available with CMake 3.13 and higher.
  67. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
  68. run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPLATFORM=Desktop
  69. - name: Build
  70. working-directory: ${{github.workspace}}/build
  71. shell: bash
  72. # Execute the build. You can specify a specific target with "--target <NAME>"
  73. run: cmake --build . --config $BUILD_TYPE
  74. - name: Test
  75. working-directory: ${{github.workspace}}/build
  76. shell: bash
  77. # Execute tests defined by the CMake configuration.
  78. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  79. run: ctest -C $BUILD_TYPE