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