-
Notifications
You must be signed in to change notification settings - Fork 24
73 lines (63 loc) · 2.25 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
gnu-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
version: [11]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up environment (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
echo "SOURCEDIR=${PWD}" >> $GITHUB_ENV
echo "WORKDIR=${PWD}" >> $GITHUB_ENV
echo "FC=gfortran" >> $GITHUB_ENV
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
sudo apt-get update
sudo apt-get install cmake ninja-build
# Note: xcode version 14.0 (default on macos-latest @ 2022-11-23) fails to link gfortran compiled
# code. Therefore, 14.1 is selected below (which seems to be installed.)
- name: Set up environment (OSX)
if: contains(matrix.os, 'macos')
run: |
xcversion select 14.1
echo "SOURCEDIR=${PWD}" >> $GITHUB_ENV
echo "WORKDIR=${PWD}" >> $GITHUB_ENV
echo "FC=gfortran-${{ matrix.version }}" >> $GITHUB_ENV
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
brew install ninja
- name: Configure build
run: |
mkdir ${WORKDIR}/_build
cd ${WORKDIR}/_build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=${WORKDIR}/_install -DWITH_FORTRAN08_API=1 -DTEST_LABELS="minimal" ${SOURCEDIR}
cd -
- name: Build project
run: |
cd ${WORKDIR}/_build
ninja all
cd -
- name: Test project
run: |
cd ${WORKDIR}/_build
ctest
cd -
- name: Install project
run: |
cd ${WORKDIR}/_build
ninja install
cd -
- name: Run integration test
run: |
mkdir ${WORKDIR}/_build_integtest
cd ${WORKDIR}/_build_integtest
CMAKE_PREFIX_PATH=${WORKDIR}/_install cmake -G Ninja ${SOURCEDIR}/serial_interface/examples/fortran08
ninja all
LD_LIBRARY_PATH=${WORKDIR}/_install/lib ./test_chimescalc ${SOURCEDIR}/serial_interface/tests/force_fields/test_params.CHON.txt ${SOURCEDIR}/serial_interface/tests/configurations/CHON.testfile.000.xyz | grep "Energy (kcal/mol): -7.83714"