Update cmake.yml #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
./waf --color=yes build | |
sudo ./waf install | |
sudo ldconfig | |
cd ../NAC-ABE | |
- name: Configure NFD | |
run: | | |
cd .. | |
git clone --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 --depth=1 https://github.com/named-data/ndn-cxx | |
cd ndn-cxx | |
# git checkout 535bd33223a63f7ec4820d90db2f8764ffb635f8 | |
./waf --color=yes configure --with-tests | |
./waf --color=yes build | |
sudo ./waf --color=yes install | |
./build/unit-tests | |
cd ../NAC-ABE | |
- name: Configure NFD | |
run: | | |
cd .. | |
git clone --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 . |