2022-01-04 21:07:37 +08:00
|
|
|
name: CMake Ubuntu
|
2020-12-09 20:14:07 +08:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
2021-04-07 19:23:48 +08:00
|
|
|
fail-fast: false
|
2020-12-09 20:14:07 +08:00
|
|
|
matrix:
|
2021-04-07 19:23:48 +08:00
|
|
|
include:
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
compiler: clang
|
|
|
|
compiler-version: 11
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
compiler: clang
|
|
|
|
compiler-version: 10
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
compiler: clang
|
|
|
|
compiler-version: "6.0"
|
|
|
|
# This compiler is supported only on a best-effort basis
|
|
|
|
ignore-errors: true
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 10
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-20.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 9
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 7
|
|
|
|
ignore-errors: false
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.ignore-errors }}
|
2020-12-09 20:14:07 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install ninja-build tool
|
|
|
|
uses: seanmiddleditch/gha-setup-ninja@v3
|
|
|
|
|
2021-04-07 19:23:48 +08:00
|
|
|
- name: Install/configure Clang compiler toolchain
|
|
|
|
if: matrix.compiler == 'clang'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -qy clang-${{matrix.compiler-version}}
|
|
|
|
echo "CXX=clang++-${{matrix.compiler-version}}" >> $GITHUB_ENV
|
|
|
|
echo "CC=clang-${{matrix.compiler-version}}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Install/configure GCC compiler toolchain
|
|
|
|
if: matrix.compiler == 'gcc'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -qy g++-${{matrix.compiler-version}}
|
|
|
|
echo "CXX=g++-${{matrix.compiler-version}}" >> $GITHUB_ENV
|
|
|
|
echo "CC=gcc-${{matrix.compiler-version}}" >> $GITHUB_ENV
|
|
|
|
|
2020-12-09 20:14:07 +08:00
|
|
|
- name: Create Build Environment
|
|
|
|
run: |
|
2020-12-16 16:08:56 +08:00
|
|
|
pip3 install absl-py clang
|
2020-12-09 20:14:07 +08:00
|
|
|
cmake -E make_directory ${{runner.workspace}}/build
|
|
|
|
|
|
|
|
- name: Configure CMake
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
run: cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
run: cmake --build . --config $BUILD_TYPE
|
|
|
|
|
|
|
|
# TODO(cblichmann): Before enabling this, make sure all OSS tests pass
|
|
|
|
#- name: Test
|
|
|
|
# working-directory: ${{runner.workspace}}/build
|
|
|
|
# run: ctest -C $BUILD_TYPE
|