add g++-6 to ubuntu-14.04 (#1144)

* add g++-6 to ubuntu-14.04

* fix syntax

* fix yamllint errors for build-and-test

* fix 'add-apt-repository' command not found

* make 'run tests' explicit

* enable testing and run both release and debug

* oops
This commit is contained in:
Dominic Hamon 2021-05-07 14:23:05 +01:00 committed by GitHub
parent 17948a78ee
commit 551a21bad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 64 additions and 46 deletions

View File

@ -2,12 +2,13 @@ name: build-and-test
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
jobs:
# TODO: add 32-bit builds (g++ and clang++) for ubuntu (requires g++-multilib and libc6:i386)
# 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
@ -28,30 +29,30 @@ jobs:
os: windows-latest
build_type: 'Debug'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: create build environment
run: cmake -E make_directory ${{ runner.workspace }}/_build
- 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: 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: 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
- 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
@ -63,34 +64,51 @@ jobs:
matrix:
build_type: ['Release', 'Debug']
compiler: [g++-4.8, clang++-3.6]
include:
- compiler: g++-6
build_type: 'Debug'
run_tests: true
- compiler: g++-6
build_type: 'Release'
run_tests: true
container: ubuntu:14.04
steps:
- uses: actions/checkout@v2
- 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: 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: 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
- 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: create build environment
run: cmake -E make_directory $GITHUB_WORKSPACE/_build
- name: build
shell: bash
working-directory: ${{ github.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}
- 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 }}
# - name: test
# shell: bash
# working-directory: ${{ github.workspace }}/_build
# run: ctest -C ${{ matrix.build_type }} -VV
- name: build
shell: bash
working-directory: ${{ github.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}
- name: test
if: ${{ matrix.run_tests }}
shell: bash
working-directory: ${{ github.workspace }}/_build
run: ctest -C ${{ matrix.build_type }} -VV