-
Notifications
You must be signed in to change notification settings - Fork 190
106 lines (91 loc) · 2.93 KB
/
ubuntu-cmake-contrib.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: ubuntu-cmake-contrib
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
contrib:
- brotli
- c-blosc
- jsonnet
- libidn2
- libraw
- libtiff
- libxls
- libzip
- lodepng
- pffft
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:
- uses: actions/checkout@v3
- 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
uses: turtlesec-no/[email protected]
- 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: Install extra dependencies for contrib
if: matrix.contrib == 'libidn2'
run: |
sudo apt-get install -qy libidn2-dev libunistring-dev
- name: Install extra dependencies for contrib
if: matrix.contrib == 'libxls'
run: |
sudo apt-get install -qy autoconf-archive gettext
- 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/contrib/${{matrix.contrib}} \
-B $GITHUB_WORKSPACE/build \
-G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DSAPI_BUILD_TESTING=ON \
-DSAPI_BUILD_EXAMPLES=ON
- name: Build
run: |
cmake \
--build $GITHUB_WORKSPACE/build \
--config $BUILD_TYPE
- name: Test
run: |
ctest \
--test-dir $GITHUB_WORKSPACE/build \
-C $BUILD_TYPE \
-E "^(sapi_|sandbox2_|regression_test)" \
--output-on-failure