Skip to content

Merge pull request #612 from JPDarby/public #500

Merge pull request #612 from JPDarby/public

Merge pull request #612 from JPDarby/public #500

Workflow file for this run

name: Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the public branch
push:
branches: [ public ]
pull_request:
branches: [ public ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ linux_x86_64_gfortran, linux_x86_64_gfortran_openmp ]
gcc_version: [ 9 ]
have_gap: [ 0, 1 ]
have_scalapack: [ 0 ]
include:
- arch: linux_x86_64_gfortran_openmp
gcc_version: 10
have_gap: 1
have_scalapack: 0
- arch: linux_x86_64_gfortran_openmpi+openmp
gcc_version: 9
have_gap: 1
have_scalapack: 1
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install dependencies
env:
QUIP_ARCH: ${{ matrix.arch }}
HAVE_GAP: ${{ matrix.have_gap }}
HAVE_SCALAPACK: ${{ matrix.have_scalapack }}
gcc_version: ${{ matrix.gcc_version }}
run: |
sudo apt-get update -y
sudo apt-get install -y gfortran libblas-dev liblapack-dev \
openmpi-bin libopenmpi-dev netcdf-bin libnetcdf-dev libhdf5-serial-dev \
python3-numpy
if [[ "$HAVE_SCALAPACK" == 1 ]]; then
sudo apt-get install -y libscalapack-openmpi-dev
fi
if [[ "$gcc_version" == 10 ]]; then
# compilers explicitly pointing to gcc-10
export F77=gfortran-10
export F90=gfortran-10
export F95=gfortran-10
export CC=gcc-10
export CPLUSPLUS=g++-10
fi
# substitute for make config
- name: Include Config
env:
QUIP_ARCH: ${{ matrix.arch }}
HAVE_SCALAPACK: ${{ matrix.have_scalapack }}
run: |
mkdir -p build/${QUIP_ARCH}
if [[ "$HAVE_SCALAPACK" == 1 ]]; then
cp -v .github/workflows/Makefile.openmpi+openmp.inc build/${QUIP_ARCH}/Makefile.inc
elif [[ "$gcc_version" == 10 ]]; then
cp -v .github/workflows/Makefile.gcc10.inc build/${QUIP_ARCH}/Makefile.inc
else
# gcc-9 is the default one in github actions containers (last checked: 2021 Aug)
cp -v .github/workflows/Makefile.inc build/${QUIP_ARCH}/Makefile.inc
fi
- name: Build QUIP
env:
QUIP_ARCH: ${{ matrix.arch }}
HAVE_GAP: ${{ matrix.have_gap }}
HAVE_SCALAPACK: ${{ matrix.have_scalapack }}
run: |
make
make libquip
make quippy
make install-quippy
# Uncomment to get SSH access for testing
# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3
- name: Test QUIP
env:
QUIP_ARCH: ${{ matrix.arch }}
HAVE_GAP: ${{ matrix.have_gap }}
HAVE_SCALAPACK: ${{ matrix.have_scalapack }}
run: |
export QUIP_ROOT=$PWD
ulimit -n 256
make test
# Builds the QUIP docs webpage image. This only happens ON the public
# branch, after tests pass and pull requests are completed
docs:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/public'
steps:
- uses: actions/checkout@v3
- name: Build documentation
run: |
sudo apt-get install -y libgsl0-dev libxpm-dev pandoc
pip install sphinx sphinx-rtd-theme nbsphinx numpydoc pygments==2.5.2 nbconvert[execute] ipython
# FIXME: currently we use the released version of quippy package to build docs,
# would be better to cache wheel from step above
pip install quippy-ase
cd doc
python -m sphinx . _build/html
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/_build/html
# Builds the QUIP docker image. This takes about 1h 20min
# this only happens ON the public branch, after pull requests
# are completed
docker:
runs-on: ubuntu-latest
needs: build # depends on the previous matrix jobs to succeed
if: github.ref == 'refs/heads/public'
steps:
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# with dev tag for now
- name: Build quip
run: |
docker build --tag libatomsquip/quip:public docker
docker push libatomsquip/quip:public