2023-05-16 19:05:31 +08:00
|
|
|
name: ubuntu-cmake
|
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:
|
2023-05-16 19:22:57 +08:00
|
|
|
# Ubuntu 22.04: Use preinstalled Clang 12.0.1, 13.0.1 and 14.0.0
|
2022-06-09 17:03:07 +08:00
|
|
|
- os: ubuntu-22.04
|
|
|
|
compiler: clang
|
2023-05-16 19:22:57 +08:00
|
|
|
compiler-version: 14
|
|
|
|
libclang-version: 14
|
|
|
|
pip-clang-version: "14.0"
|
|
|
|
ignore-errors: false
|
2022-06-09 17:03:07 +08:00
|
|
|
- os: ubuntu-22.04
|
2021-04-07 19:23:48 +08:00
|
|
|
compiler: clang
|
2023-05-16 19:22:57 +08:00
|
|
|
compiler-version: 13
|
|
|
|
libclang-version: 13
|
|
|
|
pip-clang-version: "13.0.1"
|
2021-04-07 19:23:48 +08:00
|
|
|
ignore-errors: false
|
2023-05-16 19:22:57 +08:00
|
|
|
- os: ubuntu-22.04
|
2021-04-07 19:23:48 +08:00
|
|
|
compiler: clang
|
2023-05-16 19:22:57 +08:00
|
|
|
compiler-version: 12
|
|
|
|
libclang-version: 12
|
|
|
|
pip-clang-version: "12.0.1"
|
2021-04-07 19:23:48 +08:00
|
|
|
ignore-errors: false
|
2023-05-16 19:22:57 +08:00
|
|
|
# Ubuntu 22.04: Use preinstalled GCC 9.5.0, 10.4.0, 11.3.0, 12.1.0
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 12
|
|
|
|
libclang-version: 14
|
|
|
|
pip-clang-version: "14.0"
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 11
|
|
|
|
libclang-version: 14
|
|
|
|
pip-clang-version: "14.0"
|
|
|
|
ignore-errors: false
|
|
|
|
- os: ubuntu-22.04
|
2021-04-07 19:23:48 +08:00
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 10
|
2023-05-16 19:22:57 +08:00
|
|
|
libclang-version: 14
|
|
|
|
pip-clang-version: "14.0"
|
2021-04-07 19:23:48 +08:00
|
|
|
ignore-errors: false
|
2023-05-16 19:22:57 +08:00
|
|
|
- os: ubuntu-22.04
|
2021-04-07 19:23:48 +08:00
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 9
|
2023-05-16 19:22:57 +08:00
|
|
|
libclang-version: 14
|
|
|
|
pip-clang-version: "14.0"
|
2021-04-07 19:23:48 +08:00
|
|
|
ignore-errors: false
|
2023-05-16 19:22:57 +08:00
|
|
|
# Ubuntu 20.04
|
|
|
|
- os: ubuntu-20.04
|
2021-04-07 19:23:48 +08:00
|
|
|
compiler: gcc
|
2023-05-16 19:22:57 +08:00
|
|
|
compiler-version: 8
|
|
|
|
libclang-version: 12
|
|
|
|
pip-clang-version: "12.0.1"
|
2021-04-07 19:23:48 +08:00
|
|
|
ignore-errors: false
|
2023-05-16 19:22:57 +08:00
|
|
|
- os: ubuntu-20.04
|
|
|
|
compiler: gcc
|
|
|
|
compiler-version: 7
|
|
|
|
libclang-version: 12
|
|
|
|
pip-clang-version: "12.0.1"
|
|
|
|
ignore-errors: true # GCC 7 is best effort
|
2021-04-07 19:23:48 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.ignore-errors }}
|
2020-12-09 20:14:07 +08:00
|
|
|
|
|
|
|
steps:
|
2023-05-16 19:03:17 +08:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-09 20:14:07 +08:00
|
|
|
|
2022-03-02 19:06:40 +08:00
|
|
|
- name: Cache dependencies
|
2022-04-05 21:11:54 +08:00
|
|
|
uses: actions/cache@v3
|
2022-03-02 19:06:40 +08:00
|
|
|
with:
|
|
|
|
key: ${{matrix.os}}-${{matrix.compiler}}${{matrix.compiler-version}}
|
|
|
|
path: |
|
2022-04-05 21:11:54 +08:00
|
|
|
${{github.workspace}}/build/_deps
|
2022-03-02 19:06:40 +08:00
|
|
|
|
2020-12-09 20:14:07 +08:00
|
|
|
- name: Install ninja-build tool
|
2023-06-08 11:59:53 +08:00
|
|
|
uses: turtlesec-no/get-ninja@1.1.0
|
2020-12-09 20:14:07 +08:00
|
|
|
|
2021-04-07 19:23:48 +08:00
|
|
|
- name: Install/configure Clang compiler toolchain
|
|
|
|
if: matrix.compiler == 'clang'
|
|
|
|
run: |
|
2023-05-16 19:22:57 +08:00
|
|
|
sudo apt-get install -qy \
|
|
|
|
clang-${{matrix.compiler-version}} \
|
|
|
|
libclang1-${{matrix.libclang-version}}
|
2021-04-07 19:23:48 +08:00
|
|
|
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: |
|
2023-05-16 19:22:57 +08:00
|
|
|
sudo apt-get install -qy \
|
|
|
|
g++-${{matrix.compiler-version}} \
|
|
|
|
libclang1-${{matrix.libclang-version}}
|
2021-04-07 19:23:48 +08:00
|
|
|
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: |
|
2023-05-16 19:22:57 +08:00
|
|
|
pip3 install absl-py clang==${{matrix.pip-clang-version}}
|
|
|
|
mkdir -p "$GITHUB_WORKSPACE/build"
|
2020-12-09 20:14:07 +08:00
|
|
|
|
|
|
|
- name: Configure CMake
|
2022-02-14 21:56:49 +08:00
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
cmake \
|
|
|
|
-S $GITHUB_WORKSPACE \
|
|
|
|
-B $GITHUB_WORKSPACE/build \
|
|
|
|
-G Ninja \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
2020-12-09 20:14:07 +08:00
|
|
|
|
|
|
|
- name: Build
|
2022-02-14 21:56:49 +08:00
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
cmake \
|
|
|
|
--build $GITHUB_WORKSPACE/build \
|
|
|
|
--config $BUILD_TYPE
|
2020-12-09 20:14:07 +08:00
|
|
|
|
2022-02-14 21:56:49 +08:00
|
|
|
- name: Test
|
|
|
|
run: |
|
2022-04-05 21:11:54 +08:00
|
|
|
ctest \
|
|
|
|
--test-dir $GITHUB_WORKSPACE/build \
|
|
|
|
-C $BUILD_TYPE \
|
|
|
|
--output-on-failure \
|
2022-02-14 21:56:49 +08:00
|
|
|
-R SapiTest
|