-
Notifications
You must be signed in to change notification settings - Fork 122
162 lines (138 loc) · 5.1 KB
/
Build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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