2023-05-16 19:05:31 +08:00
|
|
|
name: ubuntu-cmake-contrib
|
2022-04-05 21:30:49 +08:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-11-14 21:27:42 +08:00
|
|
|
os: [ubuntu-22.04]
|
2022-06-10 21:15:03 +08:00
|
|
|
contrib:
|
|
|
|
- brotli
|
|
|
|
- c-blosc
|
|
|
|
- jsonnet
|
2022-06-14 15:04:54 +08:00
|
|
|
- libidn2
|
2022-06-10 21:15:03 +08:00
|
|
|
- libraw
|
|
|
|
- libtiff
|
2022-06-14 20:27:12 +08:00
|
|
|
- libxls
|
2022-06-14 20:41:29 +08:00
|
|
|
- libzip
|
2022-06-10 21:15:03 +08:00
|
|
|
- lodepng
|
|
|
|
- pffft
|
2022-04-05 21:30:49 +08:00
|
|
|
ignore-errors: [true]
|
|
|
|
include:
|
|
|
|
- compiler: clang
|
|
|
|
compiler-version: 11
|
|
|
|
- compiler: gcc
|
|
|
|
compiler-version: 10
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.ignore-errors }}
|
|
|
|
|
|
|
|
steps:
|
2023-05-16 19:03:17 +08:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-05 21:30:49 +08:00
|
|
|
|
|
|
|
- name: Cache dependencies
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
key: ${{matrix.os}}-${{matrix.compiler}}${{matrix.compiler-version}}
|
|
|
|
path: |
|
|
|
|
${{github.workspace}}/build/_deps
|
|
|
|
!${{github.workspace}}/build/_deps/${{matrix.contrib}}-*/**
|
|
|
|
|
|
|
|
- name: Cache dependencies (contrib)
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
key: ${{matrix.os}}-${{matrix.compiler}}${{matrix.compiler-version}}-${{matrix.contrib}}
|
|
|
|
path: |
|
|
|
|
${{github.workspace}}/build/_deps/${{matrix.contrib}}-*/**
|
|
|
|
|
|
|
|
- name: Install ninja-build tool
|
2023-06-08 11:59:53 +08:00
|
|
|
uses: turtlesec-no/get-ninja@1.1.0
|
2022-04-05 21:30:49 +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
|
|
|
|
|
2022-06-14 15:04:54 +08:00
|
|
|
- name: Install extra dependencies for contrib
|
|
|
|
if: matrix.contrib == 'libidn2'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -qy libidn2-dev libunistring-dev
|
|
|
|
|
2022-06-15 17:58:50 +08:00
|
|
|
- name: Install extra dependencies for contrib
|
|
|
|
if: matrix.contrib == 'libxls'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -qy autoconf-archive gettext
|
|
|
|
|
2022-04-05 21:30:49 +08:00
|
|
|
- name: Create Build Environment
|
|
|
|
run: |
|
2023-11-14 23:20:32 +08:00
|
|
|
pip3 install absl-py 'clang>=14,<15'
|
2022-04-05 21:30:49 +08:00
|
|
|
cmake -E make_directory $GITHUB_WORKSPACE/build
|
|
|
|
|
|
|
|
- name: Configure CMake
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-S $GITHUB_WORKSPACE/contrib/${{matrix.contrib}} \
|
|
|
|
-B $GITHUB_WORKSPACE/build \
|
|
|
|
-G Ninja \
|
|
|
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
2022-04-21 16:17:08 +08:00
|
|
|
-DSAPI_BUILD_TESTING=ON \
|
|
|
|
-DSAPI_BUILD_EXAMPLES=ON
|
2022-04-05 21:30:49 +08:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
--build $GITHUB_WORKSPACE/build \
|
|
|
|
--config $BUILD_TYPE
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: |
|
|
|
|
ctest \
|
|
|
|
--test-dir $GITHUB_WORKSPACE/build \
|
|
|
|
-C $BUILD_TYPE \
|
2022-05-31 22:29:23 +08:00
|
|
|
-E "^(sapi_|sandbox2_|regression_test)" \
|
2022-04-05 21:30:49 +08:00
|
|
|
--output-on-failure
|