name: build
on: [push, pull_request]
env:
OMP_NUM_THREADS: 2
CXX_STANDARD: 17
MONOLITH: ON
TLX_PATH: /home/runner/work/networkit/networkit/tlx
TLX_PATH_WIN: /d/a/networkit/networkit/tlx
NATIVE: OFF
jobs:
macos-build-latest-version-apple-clang:
name: "macOS ${{ matrix.os }} (apple-clang, CPython 3.10): ${{ matrix.build-configuration }}"
runs-on: macos-${{ matrix.os }}
env:
CC: cc
CXX: c++
strategy:
matrix:
os: ['11']
build-configuration: ['full', 'full (native)']
steps:
- name: Install prerequisites
run: |
brew install libomp
brew install ninja
- name: Setup Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tlx
uses: actions/checkout@v2
with:
repository: tlx/tlx
path: tlx
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/full.sh
shell: bash
env:
TLX_PATH: /Users/runner/work/networkit/networkit/tlx
NATIVE: ${{ matrix.os == 'full (native)' }}
macos-build-latest-version-misc:
name: "macOS ${{ matrix.os }} (${{ matrix.compiler }}): core"
runs-on: macos-${{ matrix.os }}
strategy:
matrix:
os: ['11']
compiler: ['clang-15', 'gcc-11']
steps:
- name: Install prerequisites
run: |
brew install libomp
brew install ninja
- name: Install compiler llvm
if: matrix.compiler == 'clang-15'
run: |
brew reinstall llvm@15
brew link --overwrite llvm@15
- name: Install compiler gcc
if: matrix.compiler == 'gcc-11'
run: |
brew reinstall gcc@11
brew link --overwrite gcc@11
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/cpp_only.sh
shell: bash
env:
CC: ${{ matrix.compiler == 'clang-15' && '/usr/local/opt/llvm@15/bin/clang' || 'gcc-11' }}
CXX: ${{ matrix.compiler == 'clang-15' && '/usr/local/opt/llvm@15/bin/clang++' || 'g++-11' }}
linux-build-latest:
name: "Linux (gcc-11${{ startsWith(matrix.build-configuration, 'full') && ', CPython 3.11' || '' }}): ${{ matrix.build-configuration }}"
runs-on: ubuntu-20.04
env:
CC: gcc-11
CXX: g++-11
strategy:
matrix:
build-configuration: ['full', 'full (native)', 'core (non-monolithic)', 'core (C++20)']
steps:
- name: Install prerequisites
run: |
sudo add-apt-repository 'deb http://mirrors.kernel.org/ubuntu jammy main universe'
sudo apt-get update
sudo apt-get install gcc-11 g++-11 ninja-build
- name: Setup Python 3.11.0
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tlx
if: ${{ startsWith(matrix.build-configuration, 'full') }}
uses: actions/checkout@v2
with:
repository: tlx/tlx
path: tlx
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/$SCRIPT
shell: bash
env:
NATIVE: ${{ matrix.build-configuration == 'full (native)' }}
MONOLITH: ${{ matrix.build-configuration != 'core (non-monolithic)' }}
SCRIPT: ${{ startsWith(matrix.build-configuration, 'core') && 'cpp_only.sh' || 'full.sh'}}
CXX_STANDARD: ${{ matrix.build-configuration == 'core (C++20)' && '20' || env.CXX_STANDARD }}
linux-build-misc:
name: "Linux (${{ matrix.compiler }}): core"
runs-on: ubuntu-20.04
strategy:
matrix:
compiler: ['clang-15']
steps:
- name: Install prerequisites
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal llvm-toolchain-focal-15 main" | sudo tee /etc/apt/sources.list.d/llvm13.list
sudo apt-get update
sudo apt-get install clang-15 libomp-15-dev ninja-build
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tlx
uses: actions/checkout@v2
with:
repository: tlx/tlx
path: tlx
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/cpp_only.sh
shell: bash
env:
CC: clang-15
CXX: clang++-15
linux-build-min-support:
name: "Linux (${{ matrix.compiler }}, CPython 3.7): full"
runs-on: ubuntu-18.04
strategy:
matrix:
compiler: ['gcc-7', 'clang-5']
steps:
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install ninja-build
sudo apt-get install libomp5 libomp-dev clang-5.0 clang++-5.0
sudo apt-get install gcc-7 g++-7
- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tlx
uses: actions/checkout@v2
with:
repository: tlx/tlx
path: tlx
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/full.sh
shell: bash
env:
CC: ${{ matrix.compiler == 'gcc-7' && 'gcc-7' || 'clang-5.0' }}
CXX: ${{ matrix.compiler == 'gcc-7' && 'g++-7' || 'clang++-5.0' }}
linux-build-clang-tidy:
name: "Linux (clang-15): clang-tidy"
runs-on: ubuntu-20.04
env:
CC: clang
CXX: clang++
steps:
- name: Install prerequisites
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal llvm-toolchain-focal-15 main" | sudo tee /etc/apt/sources.list.d/llvm13.list
sudo apt-get update
sudo apt-get install libomp-15-dev clang-15 clang-tidy-15 ninja-build
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/clang_tidy.sh
shell: bash
linux-build-core-sanitizers-coverage:
name: "Linux (gcc-10, CPython 3.11): coverage"
runs-on: ubuntu-20.04
env:
CC: gcc-10
CXX: g++-10
COVERALLS_DUMP_FILE: coveralls.dump
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SVC_NUM: ${{ github.run_number }}
NETWORKIT_BUILD_TESTS: ON
steps:
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install ninja-build
- name: Setup Python 3.11.0
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/core_sanitizers_coverage.sh
shell: bash
timeout-minutes: 120
- name: Create C++ coverage
run: |
cd ${{ github.workspace }}
. pyenv/bin/activate
cd core_build
gcovr -e '.*test/.*' -e '.*CMakeFiles.*' -e '.*/extlibs/.*' -e '.*/scripts/.*' -e '.*/pyenv/.*' -e '.*/include/tlx/.*' --coveralls -r .. > networkit_cpp.json
gcovr -e '.*test/.*' -e '.*CMakeFiles.*' -e '.*/extlibs/.*' -e '.*/scripts/.*' -e '.*/pyenv/.*' -e '.*/include/tlx/.*' -r ..
- name: Create Python coverage and merge files
run: |
cd ${{ github.workspace }}
. pyenv/bin/activate
coverage run -m unittest discover -v networkit/test
coverage report
coveralls --merge=core_build/networkit_cpp.json --output=$COVERALLS_DUMP_FILE
- name: Upload coverage
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
cd ${{ github.workspace }}
. pyenv/bin/activate
python3 ${{ github.workspace }}/.github/workflows/scripts/upload_coverage.py
windows-build-msvc:
name: "Windows (msvc 14.31): ${{ matrix.build-configuration }}"
runs-on: windows-2022
strategy:
matrix:
build-configuration: ['core']
steps:
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Setup devCmd (vstools)
uses: ilammy/msvc-dev-cmd@v1
- name: Prepare environment and run checks
shell: bash
run: |
mkdir build && cd build
cmake -GNinja -DNETWORKIT_STATIC=ON -DNETWORKIT_BUILD_TESTS=ON -DNETWORKIT_MONOLITH=ON -DNETWORKIT_CXX_STANDARD=${{ env.CXX_STANDARD }} -DNETWORKIT_WARNINGS=ON -DCMAKE_BUILD_TYPE=Debug -DNETWORKIT_SANITY_CHECKS=ON ..
ninja
ctest -V -C Debug
windows-build-latest:
name: "Windows (msvc 14.31, CPython 3.11): ${{ matrix.build-configuration }}"
runs-on: windows-2022
strategy:
matrix:
build-configuration: ['full', 'full (native)']
steps:
- name: Setup Python 3.11.0
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout tlx
uses: actions/checkout@v2
with:
repository: tlx/tlx
path: tlx
- name: Setup devCmd (vstools)
uses: ilammy/msvc-dev-cmd@v1
- name: Prepare environment and run checks
shell: bash
run: |
cd tlx && mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.TLX_PATH_WIN }} ..
ninja && ninja install
cd ../..
python -m venv pyenv
. ./pyenv/Scripts/activate
pip install cython ipython jupyter ipywidgets==7.7.1 jupyterlab-widgets==1.1.1
mkdir build && cd build
cmake -GNinja -DNETWORKIT_BUILD_TESTS=ON -DNETWORKIT_STATIC=ON -DCMAKE_BUILD_TYPE=Release -DNETWORKIT_CXX_STANDARD=${{ env.CXX_STANDARD }} -DNETWORKIT_WARNINGS=ON -DNETWORKIT_WARNINGS_AS_ERRORS=ON -DNETWORKIT_EXT_TLX=${{ env.TLX_PATH_WIN }} -DNETWORKIT_NATIVE=${{ env.NATIVE }} ..
ninja
ctest -V -C Release
cd ..
python setup.py build_ext --inplace --external-tlx=${{ env.TLX_PATH_WIN }}
pip install -e .
python -c 'import networkit'
pip install -r requirements.txt
python -m unittest discover -v networkit/test/
pip install ipycytoscape plotly seaborn
python notebooks/test_notebooks.py "notebooks"
env:
NATIVE: ${{ matrix.os == 'full (native)' }}
documentation-build:
name: "Linux (gcc-11, CPython 3.11): documentation"
runs-on: ubuntu-20.04
env:
CC: gcc-11
CXX: g++-11
steps:
- name: Install prerequisites
run: |
sudo add-apt-repository 'deb http://mirrors.kernel.org/ubuntu jammy main universe'
sudo apt-get update
sudo apt-get install gcc-11 g++-11 ninja-build
sudo apt-get install doxygen pandoc
- name: Setup Python 3.11.0
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare environment and run checks
run: ${{ github.workspace }}/.github/workflows/scripts/documentation.sh
shell: bash
- name: Deploy networkit.github.io
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.SECRET_DEPLOY_GITHUB_PAGES }}
external_repository: networkit/dev-docs
publish_branch: master
publish_dir: ./core_build/htmldocs
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
style-guide-compliance-build:
name: "Linux (default): code-style"
runs-on: ubuntu-20.04
steps:
- name: Install prerequisites
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/focal llvm-toolchain-focal-15 main" | sudo tee /etc/apt/sources.list.d/llvm11.list
sudo apt-get update
sudo apt-get install clang-format-15 python-yaml
- name: Checkout networkit
uses: actions/checkout@v2
with:
submodules: true
- name: Prepare environment and run checks
run: |
set -e
./check_code.sh -v