-
Notifications
You must be signed in to change notification settings - Fork 8
202 lines (197 loc) · 6.31 KB
/
ci.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
---
name: OpenELP CI
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
push:
branches:
- devel
- main
- release/*
jobs:
build_and_test:
name: Build and Test
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
build_type: [Release]
include:
- os: macos-latest
test_target: test
extra_flags: -Werror
- os: ubuntu-latest
test_target: test
extra_flags: -Werror -Wformat-overflow -Wformat-security
- os: windows-latest
test_target: RUN_TESTS
extra_flags: /WX
extra_compiler_flags: >-
/experimental:external
/external:anglebrackets
/external:W0
steps:
- name: Cache PCRE2
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/build/pcre-prefix/src/pcre2-10.42.tar.gz
key: pcre2-10.42
- name: Clone project
uses: actions/checkout@v4
- name: Get snapshot ID
id: get-snap-id
shell: bash
run: echo "snap_id=git${{github.sha}}" | cut -c-19 >> $GITHUB_OUTPUT
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
run: mkdir -p build
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >-
cmake ${{github.workspace}}
-Werror=dev
-Werror=deprecated
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DBUILD_TESTING:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DOPENELP_DOC_HTMLHELP:BOOL=OFF
-DOPENELP_BUNDLE_PCRE:BOOL=ON
-DOPENELP_USE_OPENSSL:BOOL=OFF
-DCPACK_GENERATOR=ZIP
-DCPACK_PACKAGE_FILE_NAME=OpenELP-${{runner.os}}
-DCPACK_TOPLEVEL_TAG=${{runner.os}}
-DOPENELP_EXTRA_VERSION=${{steps.get-snap-id.outputs.snap_id}}
-DCMAKE_C_FLAGS="${{matrix.extra_flags}} ${{matrix.extra_compiler_flags}}"
-DCMAKE_EXE_LINKER_FLAGS="${{matrix.extra_flags}}"
-DCMAKE_SHARED_LINKER_FLAGS="${{matrix.extra_flags}}"
-DCMAKE_STATIC_LINKER_FLAGS="${{matrix.extra_flags}}"
- name: Build PCRE2
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t pcre
- name: Build project
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
- name: Test project
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t ${{matrix.test_target}}
if: ${{matrix.test_target}}
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Package project
run: >-
cmake
--build ${{runner.workspace}}/build
--config ${{matrix.build_type}}
-j2
-t package
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: OpenELP-${{runner.os}}
path: ${{runner.workspace}}/build/_CPack_Packages/${{runner.os}}/ZIP/OpenELP-${{runner.os}}/*
build_documentation:
name: Build Documentation
runs-on: ubuntu-20.04
steps:
- name: Install Prerequisites
run: sudo apt-get install libclang-cpp9 libclang1-9 -y
- name: Cache Doxygen
id: cache-doxygen
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/doxygen
key: doxygen-1.9.7
- name: Download Doxygen
if: steps.cache-doxygen.outputs.cache-hit != 'true'
working-directory: ${{runner.workspace}}
run: |
wget -O - https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz | tar -xz
mv doxygen-1.9.7 doxygen
- name: Clone project
uses: actions/checkout@v4
- name: Create build environment
shell: bash
run: |
mkdir -p ${{runner.workspace}}/build
echo "WARN_AS_ERROR = FAIL_ON_WARNINGS" >> doc/Doxyfile.in
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >-
cmake ${{github.workspace}}
-Werror=dev
-Werror=deprecated
-DCMAKE_PROGRAM_PATH:PATH="${{runner.workspace}}/doxygen/bin"
-DBUILD_TESTING:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
-DOPENELP_DOC_HTMLHELP:BOOL=OFF
-DOPENELP_BUNDLE_PCRE:BOOL=OFF
-DOPENELP_USE_OPENSSL:BOOL=OFF
-DOPENELP_EXTRA_VERSION=${{steps.get-snap-id.outputs.snap_id}}
-DOPENELP_DOC_INTERNAL=ON
- name: Build documentation
run: >-
cmake
--build ${{runner.workspace}}/build
-j2
-t doc
- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: OpenELP-HTML-Docs
path: ${{runner.workspace}}/build/doc/html/*
coverage:
name: Code Coverage
runs-on: ubuntu-20.04
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Create build environment
shell: bash
working-directory: ${{runner.workspace}}
run: mkdir -p build
- name: Configure project
working-directory: ${{runner.workspace}}/build
run: >-
cmake ${{github.workspace}}
-Wno-dev
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_TESTING:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DOPENELP_BUNDLE_PCRE:BOOL=OFF
-DOPENELP_USE_OPENSSL:BOOL=OFF
-DCMAKE_C_FLAGS="--coverage"
- name: Build project
run: >-
cmake
--build ${{runner.workspace}}/build
--config Debug
-j2
- name: Test project
run: >-
cmake
--build ${{runner.workspace}}/build
--config Debug
-j2
-t test
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
directory: ${{github.workspace}}
gcov_args: -s ${{github.workspace}}
gcov_path_exclude: '*/CompilerIdC/*'
gcov_root_dir: ${{runner.workspace}}/build
working-directory: ${{github.workspace}}