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-latest, ubuntu-20.04] 18 build_type: ['Release', 'Debug'] 19 steps: 20 - uses: actions/checkout@v2 21 22 - name: install libpfm 23 run: sudo apt -y install libpfm4-dev 24 25 - name: setup cmake 26 uses: jwlawson/actions-setup-cmake@v1.9 27 with: 28 cmake-version: '3.5.1' 29 30 - name: create build environment 31 run: cmake -E make_directory ${{ runner.workspace }}/_build 32 33 - name: configure cmake 34 shell: bash 35 working-directory: ${{ runner.workspace }}/_build 36 run: > 37 cmake $GITHUB_WORKSPACE 38 -DBENCHMARK_ENABLE_LIBPFM=1 39 -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON 40 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} 41 42 - name: build 43 shell: bash 44 working-directory: ${{ runner.workspace }}/_build 45 run: cmake --build . --config ${{ matrix.build_type }} 46 47 # Skip testing, for now. It seems perf_event_open does not succeed on the 48 # hosting machine, very likely a permissions issue. 49 # TODO(mtrofin): Enable test. 50 # - name: test 51 # shell: bash 52 # working-directory: ${{ runner.workspace }}/_build 53 # run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure 54 55 ubuntu-16_04: 56 name: ubuntu-16.04.${{ matrix.build_type }} 57 runs-on: [ubuntu-latest] 58 strategy: 59 fail-fast: false 60 matrix: 61 build_type: ['Release', 'Debug'] 62 container: ubuntu:16.04 63 steps: 64 - uses: actions/checkout@v2 65 66 - name: install required bits 67 run: | 68 apt update 69 apt -y install clang cmake g++ git 70 71 - name: install libpfm 72 run: apt -y install libpfm4-dev 73 74 - name: create build environment 75 run: cmake -E make_directory $GITHUB_WORKSPACE/_build 76 77 - name: configure cmake 78 shell: bash 79 working-directory: ${{ github.workspace }}/_build 80 run: > 81 cmake $GITHUB_WORKSPACE 82 -DBENCHMARK_ENABLE_LIBPFM=1 83 -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON 84 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} 85 86 - name: build 87 shell: bash 88 working-directory: ${{ github.workspace }}/_build 89 run: cmake --build . --config ${{ matrix.build_type }} 90 91 # Skip testing, for now. It seems perf_event_open does not succeed on the 92 # hosting machine, very likely a permissions issue. 93 # TODO(mtrofin): Enable test. 94 # - name: test 95 # shell: bash 96 # working-directory: ${{ runner.workspace }}/_build 97 # run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure 98