mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
6de30ea27f
This will speed up our builds a bit and prevent unnecessary network traffic. Setup according to the documentation for the `actions/cache@v2` action: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows Currently caching the `${{github.workspace}}/_deps` directory, as used by CMake. Cache keys look like this: `ubuntu-20.04-clang11` (`${{matrix.os}-${{matrix.compiler}}${matrix.compiler-version}}`) PiperOrigin-RevId: 431895214 Change-Id: I4ecac7c00eec8516f85f45aa2220303b811b2389
86 lines
2.4 KiB
YAML
86 lines
2.4 KiB
YAML
name: CMake Ubuntu
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
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 }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
key: ${{matrix.os}}-${{matrix.compiler}}${{matrix.compiler-version}}
|
|
path: |
|
|
${{github.workspace}}/_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 $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake --build $GITHUB_WORKSPACE --config $BUILD_TYPE
|
|
|
|
- name: Test
|
|
run: |
|
|
ctest $GITHUB_WORKSPACE -C $BUILD_TYPE --output-on-failure \
|
|
-R SapiTest
|