-
Notifications
You must be signed in to change notification settings - Fork 130
166 lines (141 loc) · 5.02 KB
/
Copy pathBuild.yml
File metadata and controls
166 lines (141 loc) · 5.02 KB
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
163
164
165
166
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, mesonify ]
pull_request:
branches: [ public, mesonify ]
# 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:
# Build and test QUIP with meson
build:
name: Build QUIP (${{ matrix.os }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14] # macos-14 is native ARM64
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y gfortran meson ninja-build \
libopenblas-dev liblapack-dev \
libnetcdf-dev libhdf5-serial-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install gcc meson ninja openblas
# Create gfortran symlink since homebrew installs versioned binaries
for gfortran_bin in /opt/homebrew/bin/gfortran-* /usr/local/bin/gfortran-*; do
if [ -f "$gfortran_bin" ]; then
sudo ln -sf "$gfortran_bin" /usr/local/bin/gfortran
break
fi
done
gfortran --version
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install numpy ase meson-python build
pip install 'f90wrap>=0.3.0'
env:
FC: gfortran
CC: gcc
- name: Build QUIP libraries
run: |
meson setup builddir
meson compile -C builddir
env:
PKG_CONFIG_PATH: ${{ runner.os == 'macOS' && '/opt/homebrew/opt/openblas/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig' || '' }}
- name: Build and install quippy
run: |
cd quippy
pip install .
env:
PKG_CONFIG_PATH: ${{ runner.os == 'macOS' && '/opt/homebrew/opt/openblas/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig' || '' }}
- name: Run quippy tests
run: |
cd tests
python run_all.py
# Uncomment to get SSH access for testing
# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 15
# Builds the QUIP docs webpage image. This only happens ON the public
# branch, after tests pass and pull requests are completed
# TEMPORARILY DISABLED - needs investigation
docs:
runs-on: ubuntu-latest
needs: build
if: false # github.ref == 'refs/heads/public'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y gfortran meson ninja-build \
libopenblas-dev pandoc
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme nbsphinx numpydoc \
pygments nbconvert ipython numpy ase meson-python
- name: Build QUIP and quippy
run: |
meson setup builddir
meson compile -C builddir
cd quippy
pip install --no-build-isolation .
- name: Build documentation
run: |
cd doc
python -m sphinx . _build/html
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v4
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
# TEMPORARILY DISABLED - needs investigation
docker:
runs-on: ubuntu-latest
needs: build # depends on the previous matrix jobs to succeed
if: false # github.ref == 'refs/heads/public'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push QUIP Docker image
run: |
docker build --tag libatomsquip/quip:public docker
docker push libatomsquip/quip:public