-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 2.94 KB
/
cpp-build.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
name: "C++ Build"
on:
# always run on main branch
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
# run on PR to main branch if relevant files changed
pull_request:
branches: [ main ]
paths:
- 'src/**'
- 'include/**'
- 'test/**'
- 'examples/**'
- 'CMakeLists.txt'
- '.github/workflows/cpp-build.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: "gcc/clang build"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cpp_compiler: "g++"
alpine_version: "v3.20"
cpp17_compatibility: "ON"
- cpp_compiler: "clang++"
alpine_version: "v3.19"
cpp17_compatibility: "OFF"
- cpp_compiler: "g++"
alpine_version: "v3.19"
cpp17_compatibility: "OFF"
- cpp_compiler: "clang++"
alpine_version: "v3.20"
cpp17_compatibility: "ON"
env:
- apk_package_cache: "/var/cache/apk"
steps:
- uses: actions/checkout@v3
- uses: jirutka/setup-alpine@v1
with:
branch: ${{ matrix.alpine_version }}
- name: Cache alpine packages
id: cache-dependencies
uses: actions/cache@v3
env:
cache-name: cache-alpine-packages
with:
path: ${{ env.apk_package_cache }}
key: ${{ runner.os }}-${{ env.cache-name }}
shell: alpine.sh --root {0}
- if: ${{ steps.cache-dependencies.outputs.cache-hit != 'true' }}
name: Install dependencies
run: |
apk update
apk add alpine-conf # install setup-apkcache
setup-apkcache ${{ env.apk_package_cache }}
apk add \
cmake \
ninja-build \
g++ \
clang \
boost-dev \
boost-filesystem \
boost-python3 \
lua5.2-dev \
python3-dev \
fmt-dev \
gtest-dev
shell: alpine.sh --root {0}
- name: Fixup environment
run: |
ln -s liblua-5.2.so.0 /usr/lib/liblua-5.2.so
ln -s /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
shell: alpine.sh --root {0}
- name: Prepare
run: |
CXX=/usr/bin/${{ matrix.cpp_compiler }} \
cmake . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DPPPLUGIN_SHARED=ON \
-DPPPLUGIN_ENABLE_EXAMPLES=ON \
-DPPPLUGIN_ENABLE_TESTS=ON \
-DPPPLUGIN_ENABLE_CPP17_COMPATIBILITY=${{ matrix.cpp17_compatibility }}
shell: alpine.sh {0}
- name: Build
run: |
cmake --build build -j
shell: alpine.sh {0}
- name: Install
run: |
cmake --install build
shell: alpine.sh --root {0}