build-and-test.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. name: build-and-test
  2. on:
  3. push: {}
  4. pull_request: {}
  5. jobs:
  6. # TODO: add 32-bit builds (g++ and clang++) for ubuntu
  7. # (requires g++-multilib and libc6:i386)
  8. # TODO: add coverage build (requires lcov)
  9. # TODO: add clang + libc++ builds for ubuntu
  10. # TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
  11. job:
  12. name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
  13. runs-on: ${{ matrix.os }}
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
  18. build_type: ['Release', 'Debug']
  19. compiler: [g++, clang++]
  20. include:
  21. - displayTargetName: windows-latest-release
  22. os: windows-latest
  23. build_type: 'Release'
  24. - displayTargetName: windows-latest-debug
  25. os: windows-latest
  26. build_type: 'Debug'
  27. steps:
  28. - uses: actions/checkout@v2
  29. - name: create build environment
  30. run: cmake -E make_directory ${{ runner.workspace }}/_build
  31. - name: configure cmake
  32. env:
  33. CXX: ${{ matrix.compiler }}
  34. shell: bash
  35. working-directory: ${{ runner.workspace }}/_build
  36. run: >
  37. cmake $GITHUB_WORKSPACE
  38. -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
  39. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  40. - name: build
  41. shell: bash
  42. working-directory: ${{ runner.workspace }}/_build
  43. run: cmake --build . --config ${{ matrix.build_type }}
  44. - name: test
  45. shell: bash
  46. working-directory: ${{ runner.workspace }}/_build
  47. run: ctest -C ${{ matrix.build_type }} -VV
  48. ubuntu-14_04:
  49. name: ubuntu-14.04.${{ matrix.build_type }}.${{ matrix.compiler }}
  50. runs-on: [ubuntu-latest]
  51. strategy:
  52. fail-fast: false
  53. matrix:
  54. build_type: ['Release', 'Debug']
  55. compiler: [g++-4.8, clang++-3.6]
  56. include:
  57. - compiler: g++-6
  58. build_type: 'Debug'
  59. run_tests: true
  60. - compiler: g++-6
  61. build_type: 'Release'
  62. run_tests: true
  63. container: ubuntu:14.04
  64. steps:
  65. - uses: actions/checkout@v2
  66. - name: install required bits
  67. run: |
  68. sudo apt update
  69. sudo apt -y install clang-3.6 cmake3 g++-4.8 git
  70. - name: install other bits
  71. if: ${{ matrix.compiler }} == g++-6
  72. run: |
  73. sudo apt -y install software-properties-common
  74. sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test"
  75. sudo apt update
  76. sudo apt -y install g++-6
  77. - name: create build environment
  78. run: cmake -E make_directory $GITHUB_WORKSPACE/_build
  79. - name: configure cmake
  80. env:
  81. CXX: ${{ matrix.compiler }}
  82. shell: bash
  83. working-directory: ${{ github.workspace }}/_build
  84. run: >
  85. cmake $GITHUB_WORKSPACE
  86. -DBENCHMARK_ENABLE_TESTING=${{ matrix.run_tests }}
  87. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  88. -DBENCHMARK_DOWNLOAD_DEPENDENCIES=${{ matrix.run_tests }}
  89. - name: build
  90. shell: bash
  91. working-directory: ${{ github.workspace }}/_build
  92. run: cmake --build . --config ${{ matrix.build_type }}
  93. - name: test
  94. if: ${{ matrix.run_tests }}
  95. shell: bash
  96. working-directory: ${{ github.workspace }}/_build
  97. run: ctest -C ${{ matrix.build_type }} -VV