1name: build-and-test 2 3on: 4 push: 5 branches: [ master ] 6 pull_request: 7 branches: [ master ] 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-16.04, ubuntu-20.04, macos-latest, windows-latest] 18 build_type: ['Release', 'Debug'] 19 steps: 20 - uses: actions/checkout@v2 21 22 - name: create build environment 23 run: cmake -E make_directory ${{ runner.workspace }}/_build 24 25 - name: configure cmake 26 shell: bash 27 working-directory: ${{ runner.workspace }}/_build 28 run: cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} 29 30 - name: build 31 shell: bash 32 working-directory: ${{ runner.workspace }}/_build 33 run: cmake --build . --config ${{ matrix.build_type }} 34 35 - name: test 36 shell: bash 37 working-directory: ${{ runner.workspace }}/_build 38 run: ctest -C ${{ matrix.build_type }} 39