2020-08-18 07:53:21 +00:00
|
|
|
name: build-and-test
|
|
|
|
|
|
|
|
on:
|
2021-06-01 14:48:44 +00:00
|
|
|
push: {}
|
|
|
|
pull_request: {}
|
2020-08-18 07:53:21 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-05-07 13:23:05 +00:00
|
|
|
# TODO: add 32-bit builds (g++ and clang++) for ubuntu
|
|
|
|
# (requires g++-multilib and libc6:i386)
|
2021-04-30 13:22:15 +00:00
|
|
|
# TODO: add coverage build (requires lcov)
|
|
|
|
# TODO: add clang + libc++ builds for ubuntu
|
|
|
|
# TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
|
2020-08-18 07:53:21 +00:00
|
|
|
job:
|
2021-04-30 13:22:15 +00:00
|
|
|
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
|
2020-08-18 07:53:21 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-04-30 13:22:15 +00:00
|
|
|
os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
|
2020-08-18 07:53:21 +00:00
|
|
|
build_type: ['Release', 'Debug']
|
2021-04-30 13:22:15 +00:00
|
|
|
compiler: [g++, clang++]
|
|
|
|
include:
|
|
|
|
- displayTargetName: windows-latest-release
|
|
|
|
os: windows-latest
|
|
|
|
build_type: 'Release'
|
|
|
|
- displayTargetName: windows-latest-debug
|
|
|
|
os: windows-latest
|
|
|
|
build_type: 'Debug'
|
2020-08-18 07:53:21 +00:00
|
|
|
steps:
|
2021-05-07 13:23:05 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-09-09 08:43:26 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: create build environment
|
|
|
|
run: cmake -E make_directory ${{ runner.workspace }}/_build
|
2020-09-09 08:43:26 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: configure cmake
|
|
|
|
env:
|
|
|
|
CXX: ${{ matrix.compiler }}
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ runner.workspace }}/_build
|
|
|
|
run: >
|
|
|
|
cmake $GITHUB_WORKSPACE
|
|
|
|
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
|
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
2020-09-09 08:43:26 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: build
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ runner.workspace }}/_build
|
|
|
|
run: cmake --build . --config ${{ matrix.build_type }}
|
2020-09-09 08:43:26 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: test
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ runner.workspace }}/_build
|
|
|
|
run: ctest -C ${{ matrix.build_type }} -VV
|
2021-05-07 11:39:04 +00:00
|
|
|
|
|
|
|
ubuntu-14_04:
|
|
|
|
name: ubuntu-14.04.${{ matrix.build_type }}.${{ matrix.compiler }}
|
|
|
|
runs-on: [ubuntu-latest]
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
build_type: ['Release', 'Debug']
|
|
|
|
compiler: [g++-4.8, clang++-3.6]
|
2021-05-07 13:23:05 +00:00
|
|
|
include:
|
|
|
|
- compiler: g++-6
|
|
|
|
build_type: 'Debug'
|
|
|
|
run_tests: true
|
|
|
|
- compiler: g++-6
|
|
|
|
build_type: 'Release'
|
|
|
|
run_tests: true
|
2021-05-07 11:39:04 +00:00
|
|
|
container: ubuntu:14.04
|
|
|
|
steps:
|
2021-05-07 13:23:05 +00:00
|
|
|
- uses: actions/checkout@v2
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: install required bits
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt -y install clang-3.6 cmake3 g++-4.8 git
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: install other bits
|
|
|
|
if: ${{ matrix.compiler }} == g++-6
|
|
|
|
run: |
|
|
|
|
sudo apt -y install software-properties-common
|
|
|
|
sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test"
|
|
|
|
sudo apt update
|
|
|
|
sudo apt -y install g++-6
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: create build environment
|
|
|
|
run: cmake -E make_directory $GITHUB_WORKSPACE/_build
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: configure cmake
|
|
|
|
env:
|
|
|
|
CXX: ${{ matrix.compiler }}
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/_build
|
|
|
|
run: >
|
|
|
|
cmake $GITHUB_WORKSPACE
|
|
|
|
-DBENCHMARK_ENABLE_TESTING=${{ matrix.run_tests }}
|
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
|
|
|
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=${{ matrix.run_tests }}
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: build
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/_build
|
|
|
|
run: cmake --build . --config ${{ matrix.build_type }}
|
2021-05-07 11:39:04 +00:00
|
|
|
|
2021-05-07 13:23:05 +00:00
|
|
|
- name: test
|
|
|
|
if: ${{ matrix.run_tests }}
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}/_build
|
|
|
|
run: ctest -C ${{ matrix.build_type }} -VV
|