Skip to content

Commit 3870848

Browse files
ni4ronaldtse
authored andcommitted
Add some basic CI for FindBotan.cmake.
Squashed commits: [85b3a83] chore: gha move FindBotan job inside matrix
1 parent adedf7e commit 3870848

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/centos8.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ jobs:
2727
ci: findossl
2828
- name: PandocMan.cmake
2929
ci: pandocman
30+
- name: FindBotan.cmake
31+
ci: findbotan
3032
fail-fast: false
31-
name: CMake modules check
33+
name: Check CMake module
3234
steps:
3335
- run: |
3436
dnf -y install git
@@ -80,3 +82,19 @@ jobs:
8082
man ./testpandoc.1
8183
man testpandoc
8284
popd
85+
- name: Check FindBotan.cmake
86+
if: matrix.module.name == 'FindBotan.cmake'
87+
run: |
88+
set -eux
89+
sudo dnf -y -q install python3-devel
90+
git clone --depth 1 --branch 2.19.3 https://github.com/randombit/botan.git
91+
pushd botan
92+
python3 configure.py && make -j2 && make -j2 install
93+
popd
94+
mkdir "${GITHUB_WORKSPACE}/build"
95+
pushd "${GITHUB_WORKSPACE}/build"
96+
cmake "${GITHUB_WORKSPACE}/ci/findbotan" "-DCMAKE_MODULE_PATH=${GITHUB_WORKSPACE}"
97+
grep -q "/usr/local/lib/libbotan-2.so" "${GITHUB_WORKSPACE}/ci/findbotan/findbotan.txt"
98+
grep -q "/usr/local/include/botan-2" "${GITHUB_WORKSPACE}/ci/findbotan/findbotan.txt"
99+
popd
100+

ci/findbotan/CMakeLists.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project(test-findbotan
4+
LANGUAGES C
5+
)
6+
7+
include(FindBotan)
8+
find_package(Botan 2.0 REQUIRED)
9+
10+
file(WRITE findbotan.txt "BOTAN_LIBRARY: ${BOTAN_LIBRARY}\n")
11+
file(APPEND findbotan.txt "BOTAN_INCLUDE_DIR: ${BOTAN_INCLUDE_DIR}\n")
12+
13+
if(NOT DEFINED BOTAN_LIBRARY OR "${BOTAN_LIBRARY}" STREQUAL "")
14+
message(FATAL_ERROR "BOTAN_LIBRARY is not set.")
15+
endif()
16+
17+
if(NOT DEFINED BOTAN_INCLUDE_DIR OR "${BOTAN_INCLUDE_DIR}" STREQUAL "")
18+
message(FATAL_ERROR "BOTAN_INCLUDE_DIR is not set.")
19+
endif()

0 commit comments

Comments
 (0)