Update workflow files #121
Workflow file for this run
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: build_and_test | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
builds: | |
name: "${{ matrix.name }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- name: "Ubuntu Jammy clang-14 build" | |
os: ubuntu-22.04 | |
cpp_compiler: clang++ | |
- name: "Ubuntu Jammy gcc-11 build" | |
os: ubuntu-22.04 | |
cpp_compiler: g++-11 | |
- name: "Ubuntu Jammy gcc-10 build" | |
os: ubuntu-22.04 | |
cpp_compiler: g++-10 | |
- name: "Mac OS clang-14 build" | |
os: macos-12 | |
cpp_compiler: clang++ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install (Ubuntu) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends ninja-build clang-tidy-14 libcurl4-openssl-dev | |
sudo ln -s /usr/bin/clang-tidy-14 /usr/local/bin/clang-tidy | |
- name: Install (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
brew install ninja | |
sudo ln -s /usr/local/opt/llvm/bin/clang-tidy /usr/local/bin/clang-tidy | |
- name: Set environment variables | |
run: | | |
echo CXX="${{ matrix.cpp_compiler }}" >> $GITHUB_ENV | |
# '>' converts newlines into spaces | |
- name: Configure | |
run: > | |
cmake | |
-B build | |
-G Ninja | |
-DCMAKE_BUILD_TYPE=Release | |
-DBUILD_SHARED_LIBS=ON | |
- name: Build | |
run: cmake --build build | |
code_coverage: | |
name: "Run testcases with Code Coverage" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends libcurl4-openssl-dev gcovr | |
# '>' converts newlines into spaces | |
- name: Configure | |
run: > | |
cmake | |
-B build | |
-DCMAKE_BUILD_TYPE=Debug | |
-DCOVERAGE=ON | |
-DBUILD_SHARED_LIBS=ON | |
- name: Install IPFS | |
env: | |
GO_IPFS_VERSION: "v0.20.0" | |
run: | | |
GO_IPFS_DOWNLOAD_URL="https://dist.ipfs.io/go-ipfs/${GO_IPFS_VERSION}/go-ipfs_${GO_IPFS_VERSION}_linux-amd64.tar.gz" | |
GO_IPFS_DIR="${GITHUB_WORKSPACE}/go-ipfs" | |
GO_IPFS_ARCHIVE_FULLPATH="${GO_IPFS_DIR}/go-ipfs.tar.gz" | |
echo GO_IPFS_CMD="${GO_IPFS_DIR}/go-ipfs/ipfs" >> $GITHUB_ENV | |
mkdir -p "${GO_IPFS_DIR}" | |
wget --quiet -O "${GO_IPFS_ARCHIVE_FULLPATH}" "${GO_IPFS_DOWNLOAD_URL}" | |
tar -C "${GO_IPFS_DIR}" -vzxf "${GO_IPFS_ARCHIVE_FULLPATH}" | |
rm -rf "${GO_IPFS_ARCHIVE_FULLPATH}" | |
- name: Test | |
working-directory: ./build | |
run: | | |
./../scripts/ipfs_daemon_start.sh | |
make ctest_coverage_xml | |
./../scripts/ipfs_daemon_stop.sh | |
env: | |
CTEST_OUTPUT_ON_FAILURE: ON | |
- uses: codecov/codecov-action@v3 | |
with: | |
file: ./build/ctest_coverage_xml.xml | |
doxygen: | |
name: "Generate Doxygen" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends libcurl4-openssl-dev | |
- name: Install latest Doxygen (v1.9.7) | |
run: | | |
wget https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz | |
tar -xf doxygen-1.9.7.linux.bin.tar.gz | |
cd doxygen-1.9.7 | |
sudo make install | |
- name: Configure | |
run: > | |
cmake | |
-B build | |
-DDOC=ON | |
- name: Build Doxygen | |
working-directory: ./build | |
run: make doc | |
static_analytics: | |
name: "Static code analysis" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install | |
run: | | |
sudo apt update | |
sudo apt install -y --no-install-recommends clang-tidy-14 libcurl4-openssl-dev | |
sudo ln -s /usr/bin/clang-tidy-14 /usr/local/bin/clang-tidy | |
- name: Analysis | |
run: | | |
CCC_CXX=clang++-10 scan-build-14 --status-bugs cmake -DBUILD_SHARED_LIBS=ON "${SOURCE_DIR}" | |
CCC_CXX=clang++-10 scan-build-14 --status-bugs make VERBOSE=1 | |
code_style_guidelines: | |
name: "Coding style guidelines" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check style format | |
run: ./scripts/check_format.sh |