build_cmake.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: CMake
  2. on: [push]
  3. env:
  4. # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  5. BUILD_TYPE: RelWithDebInfo
  6. jobs:
  7. build:
  8. runs-on: ${{ matrix.os }}
  9. strategy:
  10. matrix:
  11. os: [ubuntu-latest]
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Install Dependencies
  15. run: |
  16. sudo apt-get -y -qq update
  17. sudo apt-get -y --no-install-recommends install \
  18. cmake \
  19. extra-cmake-modules \
  20. build-essential \
  21. qt5-default \
  22. qt5-qmake \
  23. qttools5-dev-tools \
  24. qttools5-dev \
  25. libqt5dbus5 \
  26. libqt5network5 \
  27. libqt5core5a \
  28. libqt5widgets5 \
  29. libqt5gui5 \
  30. libqt5svg5-dev
  31. - name: Create Build Environment
  32. # Some projects don't allow in-source building, so create a separate build directory
  33. # We'll use this as our working directory for all subsequent commands
  34. run: cmake -E make_directory ${{runner.workspace}}/build
  35. - name: Configure CMake
  36. # Use a bash shell so we can use the same syntax for environment variable
  37. # access regardless of the host operating system
  38. shell: bash
  39. working-directory: ${{runner.workspace}}/build
  40. # Note the current convention is to use the -S and -B options here to specify source
  41. # and build directories, but this is only available with CMake 3.13 and higher.
  42. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
  43. #
  44. # We need to source the profile file to make sure conan is in PATH
  45. run: |
  46. cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
  47. - name: Build
  48. working-directory: ${{runner.workspace}}/build
  49. shell: bash
  50. # Execute the build. You can specify a specific target with "--target <NAME>"
  51. run: cmake --build . --config $BUILD_TYPE
  52. - name: Test
  53. working-directory: ${{runner.workspace}}/build
  54. shell: bash
  55. # Execute tests defined by the CMake configuration.
  56. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
  57. run: ctest -C $BUILD_TYPE