-
Notifications
You must be signed in to change notification settings - Fork 11
224 lines (200 loc) · 7.59 KB
/
cmake.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: CMake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
ubuntu-build:
name: ${{ matrix.compiler }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [g++-8, g++-9, g++-10, g++-11,
clang++-7, clang++-8, clang++-9, clang++-10, clang++-11, clang++-12]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
env:
CXX: ${{ matrix.compiler }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get -qy install software-properties-common
sudo add-apt-repository -ny ppa:named-data/ppa
sudo apt-get -qq update
sudo apt-get -y install build-essential pkg-config cmake doxygen python3-pip \
python3-minimal libboost-all-dev libsqlite3-dev libpcap-dev \
libssl-dev libsodium-dev libz-dev liblog4cxx-dev libgtest-dev libfl-dev $CXX
- name: Install OpenABE
run: |
cd ..
git clone https://github.com/zeutro/openabe.git
cd openabe
sudo -E ./deps/install_pkgs.sh
. ./env
cd deps/relic
make
cd ../..
NO_DEPS=1 BISON=$(which bison) make
# test is no longer compliable after b8f9d3c8a2620c1185ca972248f7af39c1eae68c
# make test
sudo -E make install
cd ../NAC-ABE
- name: Configure ndn-cxx
run: |
cd ..
git clone --depth=1 https://github.com/named-data/ndn-cxx
cd ndn-cxx
./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain
./waf --color=yes build
sudo ./waf install
sudo ldconfig
cd ../NAC-ABE
- name: Configure NFD
run: |
cd ..
git clone -b NFD-22.12 --depth=1 https://github.com/named-data/NFD
cd NFD
git submodule update --init
./waf --color=yes configure
./waf --color=yes build
sudo ./waf install
sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
cd ../NAC-ABE
nfd-start
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DHAVE_TESTS=True -DBUILD_EXAMPLES=True
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
env:
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
CTEST_OUTPUT_ON_FAILURE: 1
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cp ../tests/unit-tests/trust-schema.conf trust-schema.conf
./tests/unit-tests
bash ./../examples/run-examples.sh .
macos-build:
name: Xcode ${{ matrix.xcode }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-11 ]
xcode: [ '12.4', '12.5', '13.2' ]
include:
- os: macos-12
xcode: '13.4'
- os: macos-12
xcode: '14.2'
runs-on: ${{ matrix.os }}
steps:
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout
uses: actions/checkout@v3
- name: Configure googletest
run: |
cd ..
wget https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz
tar -xzvf release-1.12.1.tar.gz
cd googletest-release-1.12.1
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
cd ../..
- name: Install dependencies
run: |
FORMULAE=(boost openssl pkg-config bison gsed [email protected])
# GitHub Actions runners have a large number of pre-installed
# Homebrew packages. Don't waste time upgrading all of them.
brew list --versions "${FORMULAE[@]}" || brew update
for FORMULA in "${FORMULAE[@]}"; do
brew list --versions "$FORMULA" || brew install "$FORMULA"
done
# Ensure /usr/local/opt/openssl exists
# brew reinstall openssl [email protected]
- name: Install OpenABE
run: |
cd ..
git clone https://github.com/zeutro/openabe.git
cd openabe
mv VERSION OpenABE-VERSION
sudo -E ./deps/install_pkgs.sh
. ./env
cd deps/relic
PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH" make
cd ../..
ln -sf /usr/local/opt/[email protected]/include/openssl /usr/local/include
ln -sf /usr/local/opt/[email protected]/lib/lib* /usr/local/lib
NO_DEPS=1 BISON="$(brew --prefix bison)/bin/bison" make
# test is no longer compliable after b8f9d3c8a2620c1185ca972248f7af39c1eae68c
# make test
sudo -E make install
cd ../NAC-ABE
env:
LDFLAGS: "-L/usr/local/opt/[email protected]/lib"
- name: Configure ndn-cxx
run: |
cd ..
git clone https://github.com/named-data/ndn-cxx
cd ndn-cxx
git checkout 535bd33223a63f7ec4820d90db2f8764ffb635f8
./waf --color=yes configure --with-tests --without-osx-keychain
./waf --color=yes build
sudo ./waf --color=yes install
./build/unit-tests
cd ../NAC-ABE
- name: Configure NFD
run: |
cd ..
git clone -b NFD-22.12 --depth=1 https://github.com/named-data/NFD
cd NFD
git submodule update --init
./waf --color=yes configure
./waf --color=yes build
sudo ./waf --color=yes install
sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
cd ../NAC-ABE
sudo nfd-start
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DHAVE_TESTS=True -DBUILD_EXAMPLES=True
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
env:
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
CTEST_OUTPUT_ON_FAILURE: 1
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cp ../tests/unit-tests/trust-schema.conf trust-schema.conf
./tests/unit-tests
bash ./../examples/run-examples.sh .