Skip to content

Build and deploy

Build and deploy #105

name: Build and deploy
on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 6'
jobs:
build:
strategy:
matrix:
include:
- {os: ubuntu-20.04, cc: gcc-10, cxx: g++-10}
- {os: ubuntu-20.04, cc: clang-13, cxx: clang++-13}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Update apt-get cache
run: sudo apt-get update
- name: Install Ubuntu dependencies
run: >
sudo apt-get install lsb-release wget software-properties-common &&
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh &&
sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 13 &&
sudo apt-get install
g++-10
clang-13
libclang-13-dev
libgfortran4
gfortran
openmpi-bin
openmpi-common
openmpi-doc
libopenmpi-dev
libblas-dev
liblapack-dev
libfftw3-dev
libgmp-dev
hdf5-tools
libhdf5-dev
python3-dev
python3-clang-13
python3-numpy
python3-scipy
python3-matplotlib
ipython3
python3-mpi4py
python3-mako
- name: Download Boost (a C++20 compatible version)
run: |
wget -q https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.bz2
tar -xf boost_1_78_0.tar.bz2
mv boost_1_78_0 boost
- name: Install Sphinx and related packages
if: startsWith(matrix.cxx, 'clang')
run: |
python -m pip install --upgrade pip
pip install sphinx nbsphinx linkify-it-py sphinx-rtd-theme myst-parser
- name: Build & install TRIQS
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
git clone https://github.com/TRIQS/triqs --branch 3.1.x
mkdir triqs/build && pushd triqs/build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=$HOME/install \
-DBoost_INCLUDE_DIR=$(readlink -f ../../boost) \
-DBuild_Tests=OFF
make -j2 install VERBOSE=1
popd
- name: Build SOM
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
source $HOME/install/share/triqs/triqsvars.sh
if [[ "${CXX}" == clang* ]]; then
DOCS="ON"
else
DOCS="OFF"
fi
mkdir build && pushd build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=ON \
-DBoost_INCLUDE_DIR=$(readlink -f ../boost) \
-DBuild_Documentation=${DOCS}
make -j2 VERBOSE=1
popd
- name: Test SOM
run: |
sudo sh -c 'echo -e "\nrmaps_base_oversubscribe = 1" >> \
/etc/openmpi/openmpi-mca-params.conf'
pushd build
source $HOME/install/share/triqs/triqsvars.sh
ctest --output-on-failure
popd
- name: Deploy documentation
if: github.ref == 'refs/heads/master' && startsWith(matrix.cxx, 'clang')
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/doc/html