-
Notifications
You must be signed in to change notification settings - Fork 190
130 lines (118 loc) · 3.81 KB
/
ubuntu-cmake.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: ubuntu-cmake
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Ubuntu 22.04: Use preinstalled Clang 12.0.1, 13.0.1 and 14.0.0
- os: ubuntu-22.04
compiler: clang
compiler-version: 14
libclang-version: 14
pip-clang-version: "14.0"
ignore-errors: false
- os: ubuntu-22.04
compiler: clang
compiler-version: 13
libclang-version: 13
pip-clang-version: "13.0.1"
ignore-errors: false
- os: ubuntu-22.04
compiler: clang
compiler-version: 12
libclang-version: 12
pip-clang-version: "12.0.1"
ignore-errors: false
# 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
compiler: gcc
compiler-version: 10
libclang-version: 14
pip-clang-version: "14.0"
ignore-errors: false
- os: ubuntu-22.04
compiler: gcc
compiler-version: 9
libclang-version: 14
pip-clang-version: "14.0"
ignore-errors: false
# Ubuntu 20.04
- os: ubuntu-20.04
compiler: gcc
compiler-version: 8
libclang-version: 12
pip-clang-version: "12.0.1"
ignore-errors: false
- 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
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
- 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}} \
libclang1-${{matrix.libclang-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}} \
libclang1-${{matrix.libclang-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==${{matrix.pip-clang-version}}
mkdir -p "$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