-
Notifications
You must be signed in to change notification settings - Fork 211
210 lines (193 loc) · 6.4 KB
/
linux.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
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
203
204
205
206
207
208
209
210
name: linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_linux_autotools_default_args:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y texlive texinfo texi2html doxygen
- name: create configure
run: autoreconf -i
- name: configure default
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make install
run: sudo make install
build_linux_autotools_other_args:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y texlive texinfo texi2html doxygen
- name: create configure
run: autoreconf -i
- name: configure default
run: ./configure --disable-fork --disable-subunit --enable-snprintf-replacement --enable-timer-replacement
- name: make
run: make
- name: make check
run: make check
- name: make install
run: sudo make install
build_linux_autotools_gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create configure
run: autoreconf -i
- name: configure gcc
run: ./configure CC=gcc --enable-snprintf-replacement --enable-timer-replacement --disable-build-docs --disable-timeout-tests
- name: make
run: make
- name: make check
run: make check
build_linux_autotools_clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: create configure
run: autoreconf -i
- name: configure clang
run: ./configure CC=clang --enable-snprintf-replacement --enable-timer-replacement --disable-build-docs --disable-timeout-tests
- name: make
run: make
build_linux_autotools_crosscompile_mingw32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y gcc-mingw-w64
- name: create configure
run: autoreconf -i
- name: configure clang
run: ./configure --disable-build-docs --host=x86_64-w64-mingw32 --disable-static --disable-subunit
- name: make
run: make
build_linux_autotools_prereleasecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y texlive texinfo texi2html doxygen
- name: create configure
run: autoreconf -i
- name: configure default
run: ./configure
- name: make prereleasecheck
run: make prereleasecheck
build_linux_autotools_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y texlive texinfo texi2html doxygen
- name: create configure
run: autoreconf -i
- name: configure default
run: ./configure
- name: make docs
run: make doc/check_html
- name: make doxygen
run: make doc/doxygen
build_linux_autotools_example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install doc packages
run: sudo apt-get install -y texlive texinfo texi2html doxygen
- name: create configure
run: autoreconf -i
- name: configure default
run: ./configure
- name: make
run: make
- name: make install
run: sudo make install
- name: create configure example
working-directory: doc/example
run: autoreconf -i
- name: configure example
working-directory: doc/example
run: ./configure
- name: build example
working-directory: doc/example
run: make
- name: test example
working-directory: doc/example
run: make check
build_linux_cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: cmake cversion
run: cmake --version
- name: create configs
run: cmake .
- name: make
run: make
- name: unit tests
run: ctest -V
- name: make install
run: sudo make install
build_linux_scanbuild:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install scan-build packages
run: sudo apt-get install -y clang-tools
- name: create configure
run: autoreconf -i
- name: configure
run: scan-build ./configure --enable-timer-replacement --disable-build-docs
- name: make
run: scan-build -o clang make
- name: check for issues
run: |
if [ -n "$(find clang -type f)" ]; then
echo "scan-build found potential issues"
find clang -type f -print -exec cat \{} \;
exit 1
fi
build_linux_cmake_project_usage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run test
run: |
cmake --version || exit 1
project_dir="project_cmake"
install_dir="${PWD}/install_cmake"
build_dir="${PWD}/build_cmake"
# For FetchContent we copy everything to a subdir.
# Otherwise the copying would be recursive and forever.
echo "setup project dir"
mkdir "$project_dir" || exit 1
find . -maxdepth 1 -print | grep -v -E "^(\.|\./${project_dir})\$" | grep -v '^\./\.git.*$' | xargs cp -R -t "$project_dir" || exit 1
# For find_package we need the project built and installed
echo "build and install"
mkdir "$build_dir" && cd "$build_dir" || exit 1
cmake -D BUILD_TESTING=OFF -D CMAKE_INSTALL_PREFIX="${install_dir}" ../project_cmake || exit 1
make && make install || exit 1
cd .. || exit 1
echo "test fetch content"
cp -R tests/cmake_project_usage_test . || exit 1
proj_dir="$PWD/${project_dir}"
build_dir="build_fetch_content"
mkdir $build_dir && cd $build_dir || exit 1
INCLUDE_CHECK_WITH='FetchContent' INCLUDE_CHECK_FROM="file://${proj_dir}" cmake -D CMAKE_BUILD_TYPE=Debug ../cmake_project_usage_test || exit 1
make && src/tests.test || exit 1
cd .. || exit 1
echo "test find package"
build_dir='build_find_package_config'
mkdir $build_dir && cd $build_dir || exit 1
INCLUDE_CHECK_WITH='find_package_config' Check_ROOT="${install_dir}" cmake -D CMAKE_BUILD_TYPE=Debug ../cmake_project_usage_test || exit 1
make && src/tests.test || exit 1
cd .. || exit 1