sandboxed-api/.github/workflows/ubuntu-cmake.yml
Christian Blichmann 95afede8a0 GitHub Actions: Add Ubuntu 22.04 builds
Ubuntu 22.04 is an LTS version, so we should add it. This change set
`ignore-errors = true`, as the corresponding build environment is still in
beta on GitHub.

PiperOrigin-RevId: 453868434
Change-Id: I988e38cda30deedd0704314f21a1f4c33c1456a0
2022-06-09 02:03:48 -07:00

105 lines
2.9 KiB
YAML

name: CMake Ubuntu
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
compiler: clang
compiler-version: 11
# Ubuntu 22.04 is in beta
ignore-errors: true
- os: ubuntu-22.04
compiler: gcc
compiler-version: 11
# Ubuntu 22.04 is in beta
ignore-errors: true
- 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 }}
steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v3
with:
key: ${{matrix.os}}-${{matrix.compiler}}${{matrix.compiler-version}}
path: |
${{github.workspace}}/build/_deps
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
- 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
- name: Create Build Environment
run: |
pip3 install absl-py clang
cmake -E make_directory $GITHUB_WORKSPACE/build
- name: Configure CMake
run: |
cmake \
-S $GITHUB_WORKSPACE \
-B $GITHUB_WORKSPACE/build \
-G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
run: |
cmake \
--build $GITHUB_WORKSPACE/build \
--config $BUILD_TYPE
- name: Test
run: |
ctest \
--test-dir $GITHUB_WORKSPACE/build \
-C $BUILD_TYPE \
--output-on-failure \
-R SapiTest