@@ -19,13 +19,63 @@ jobs:
19
19
- uses : actions/checkout@v3
20
20
- run : sudo apt update
21
21
- run : sudo apt install build-essential cmake ninja-build
22
- - run : sudo apt install libjsoncpp -dev libgoogle-glog-dev libunwind -dev
22
+ - run : sudo apt install libunwind -dev libgflags -dev
23
23
24
24
- name : Setup Ninja
25
25
uses : ashutoshvarma/setup-ninja@master
26
26
with :
27
27
version : 1.10.0
28
28
29
+ - name : Cache jsoncpp
30
+ id : cache-jsoncpp
31
+ uses : actions/cache@v2
32
+ with :
33
+ path : jsoncpp/
34
+ key : ${{runner.os}}-jsoncpp-1.9.5
35
+
36
+ - name : Download jsoncpp
37
+ if : steps.cache-jsoncpp.outputs.cache-hit != 'true'
38
+ run : |
39
+ wget https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.9.5.tar.gz
40
+ tar xvf 1.9.5.tar.gz
41
+
42
+ - name : Build jsoncpp
43
+ if : steps.cache-jsoncpp.outputs.cache-hit != 'true'
44
+ run : |
45
+ cmake -S jsoncpp-1.9.5 -B build-jsoncpp \
46
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
47
+ -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/jsoncpp \
48
+ -DBUILD_OBJECT_LIBS=OFF \
49
+ -DJSONCPP_WITH_TESTS=OFF \
50
+ -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
51
+ -DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF \
52
+ -G Ninja
53
+ cmake --build build-jsoncpp --target install
54
+
55
+ - name : Cache glog
56
+ id : cache-glog
57
+ uses : actions/cache@v2
58
+ with :
59
+ path : glog/
60
+ key : ${{runner.os}}-glog-0.6.0
61
+
62
+ - name : Download glog
63
+ if : steps.cache-glog.outputs.cache-hit != 'true'
64
+ run : |
65
+ wget https://github.com/google/glog/archive/refs/tags/v0.6.0.tar.gz
66
+ tar xvf v0.6.0.tar.gz
67
+
68
+ - name : Build glog
69
+ if : steps.cache-glog.outputs.cache-hit != 'true'
70
+ run : |
71
+ cmake -S glog-0.6.0 -B build-glog \
72
+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
73
+ -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/glog \
74
+ -DWITH_PKGCONFIG=OFF \
75
+ -DWITH_GTEST=OFF \
76
+ -G Ninja
77
+ cmake --build build-glog --target install
78
+
29
79
- name : Configure CMake
30
80
env :
31
81
# unit test option:
@@ -38,10 +88,17 @@ jobs:
38
88
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
39
89
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
40
90
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
91
+ -DCMAKE_PREFIX_PATH="${{github.workspace}}/jsoncpp;${{github.workspace}}/glog" \
41
92
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install \
42
93
-G Ninja \
43
94
-Werror
44
95
45
96
- name : Build
46
97
# Build your program with the given configuration
47
98
run : cmake --build ${{github.workspace}}/build_${{matrix.build_type}} --config ${{matrix.build_type}}
99
+
100
+ - name : Install
101
+ run : |
102
+ cmake --build build_${{matrix.build_type}} \
103
+ --config ${{matrix.build_type}} \
104
+ --target install
0 commit comments