benchmark/.github/workflows/build-and-test.yml
Dominic Hamon a53b8853aa
Add ubuntu-14.04 build and test workflow (#1131)
* Add ubuntu-14.04 build and test workflow

* avoid '.' in job name

* no need for fail fast

* fix workflow syntax

* install some stuff

* better compiler installations

* update before install

* just say yes

* trying to match up some paths

* Difference between runner and github context in container?

* Try some judicious logging

* cmake 3.5+ required

* specific compiler versions

* need git for googletest

* Disable testing on old compilers

* disable testing properly
2021-05-07 12:39:04 +01:00

97 lines
2.9 KiB
YAML

name: build-and-test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# TODO: add 32-bit builds (g++ and clang++) for ubuntu (requires g++-multilib and libc6:i386)
# TODO: add coverage build (requires lcov)
# TODO: add clang + libc++ builds for ubuntu
# TODO: add clang + ubsan/asan/msan + libc++ builds for ubuntu
job:
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-16.04, ubuntu-20.04, macos-latest]
build_type: ['Release', 'Debug']
compiler: [g++, clang++]
include:
- displayTargetName: windows-latest-release
os: windows-latest
build_type: 'Release'
- displayTargetName: windows-latest-debug
os: windows-latest
build_type: 'Debug'
steps:
- uses: actions/checkout@v2
- name: create build environment
run: cmake -E make_directory ${{ runner.workspace }}/_build
- 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 }}
- name: build
shell: bash
working-directory: ${{ runner.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}
- name: test
shell: bash
working-directory: ${{ runner.workspace }}/_build
run: ctest -C ${{ matrix.build_type }} -VV
# TODO: add compiler g++-6 to ubuntu-14.04 job
# TODO: enable testing for g++-6 compiler
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]
container: ubuntu:14.04
steps:
- uses: actions/checkout@v2
- name: install required bits
run: sudo apt update && sudo apt -y install clang-3.6 cmake3 g++-4.8 git
- name: create build environment
run: cmake -E make_directory $GITHUB_WORKSPACE/_build
- name: configure cmake
env:
CXX: ${{ matrix.compiler }}
shell: bash
working-directory: ${{ github.workspace }}/_build
run: >
cmake $GITHUB_WORKSPACE
-DBENCHMARK_ENABLE_TESTING=off
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
#-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
- name: build
shell: bash
working-directory: ${{ github.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}
# - name: test
# shell: bash
# working-directory: ${{ github.workspace }}/_build
# run: ctest -C ${{ matrix.build_type }} -VV