From 551a21bad0ba349a0b0434d4276547b26f8d5d01 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Fri, 7 May 2021 14:23:05 +0100 Subject: [PATCH] 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 --- .github/workflows/build-and-test.yml | 110 ++++++++++++++++----------- 1 file changed, 64 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f1f8cdb4..5a5a101a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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