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.

51 lines
1.4 KiB

2 months ago
  1. name: build-and-test-perfcounters
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. jobs:
  8. job:
  9. # TODO(dominic): Extend this to include compiler and set through env: CC/CXX.
  10. name: ${{ matrix.os }}.${{ matrix.build_type }}
  11. runs-on: ${{ matrix.os }}
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. os: [ubuntu-22.04, ubuntu-20.04]
  16. build_type: ['Release', 'Debug']
  17. steps:
  18. - uses: actions/checkout@v3
  19. - name: install libpfm
  20. run: |
  21. sudo apt update
  22. sudo apt -y install libpfm4-dev
  23. - name: create build environment
  24. run: cmake -E make_directory ${{ runner.workspace }}/_build
  25. - name: configure cmake
  26. shell: bash
  27. working-directory: ${{ runner.workspace }}/_build
  28. run: >
  29. cmake $GITHUB_WORKSPACE
  30. -DBENCHMARK_ENABLE_LIBPFM=1
  31. -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
  32. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
  33. - name: build
  34. shell: bash
  35. working-directory: ${{ runner.workspace }}/_build
  36. run: cmake --build . --config ${{ matrix.build_type }}
  37. # Skip testing, for now. It seems perf_event_open does not succeed on the
  38. # hosting machine, very likely a permissions issue.
  39. # TODO(mtrofin): Enable test.
  40. # - name: test
  41. # shell: bash
  42. # working-directory: ${{ runner.workspace }}/_build
  43. # run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure