You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

71 lines
1.8 KiB

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# 3 jobs in total
os: [ubuntu-18.04, macOS-latest]
compiler: [{
"cc": "gcc",
"cxx": "g++"
}, {
"cc": "clang",
"cxx": "clang++"
}]
exclude:
- os: macOS-latest
compiler:
cc: gcc
steps:
- uses: actions/checkout@v1
name: checkout
with:
submodules: true
clean: true
fetch-depth: 1
- name: install dependencies
run: |
set -e
if [ "$RUNNER_OS" = "macOS" ]; then
brew install ninja
else
sudo apt-get update || true
sudo apt-get install -y ninja-build
fi
sudo python3 -m pip install --upgrade pip
sudo pip3 install scikit-build cmake requests gitpython gcovr pyyaml
- name: cmake
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # has to be included to access other secrets
GITHUB_HUNTER_USERNAME: ${{ secrets.GITHUB_HUNTER_USERNAME }}
GITHUB_HUNTER_TOKEN: ${{ secrets.GITHUB_HUNTER_TOKEN }}
run: cmake . -GNinja -Bbuild
- name: build
run: cmake --build build -- -j4
- name: test
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: cmake --build build --target test
# TODO(warchant): on CI (linux/clang) this can not be built, figure out why
# - name: install & test
# run: |
# # install libp2p and include it as a subproject through find_package
# sudo cmake --build build --target install
# cd example/00-install
# mkdir build && cd build
# cmake .. && make
# ./main