-
Notifications
You must be signed in to change notification settings - Fork 136
136 lines (125 loc) · 4.13 KB
/
main.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
# modified version of:
# https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
name: CI
on: [push, pull_request, release]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu_latest_gcc_arma",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
fc: "gfortran",
linalg: "arma"
}
- {
name: "ubuntu_latest_gcc_eigen",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
fc: "gfortran",
linalg: "eigen"
}
- {
name: "ubuntu_latest_gcc9_arma",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-9",
cxx: "g++-9",
fc: "gfortran-9",
linalg: "arma"
}
- {
name: "ubuntu_latest_gcc9_eigen",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-9",
cxx: "g++-9",
fc: "gfortran-9",
linalg: "eigen"
}
- {
name: "macos_latest_clang_arma",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
linalg: "arma"
}
- {
name: "macos_latest_clang_eigen",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
linalg: "eigen"
}
steps:
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install ${{ matrix.config.cc }} ${{ matrix.config.cxx }} ${{ matrix.config.fc }} libblas-dev liblapack-dev
${{ matrix.config.cc }} --version
- name: Configure
shell: bash
run: |
export CC=${{ matrix.config.cc }}
export CXX=${{ matrix.config.cxx }}
export FC=${{ matrix.config.fc }}
WDIR=${PWD}
if [[ "${{ matrix.config.linalg }}" == "arma" ]]; then
export OPTIM_TEST_USE_ARMA="y"
mkdir ${WDIR}/arma_tmp
git clone --single-branch https://gitlab.com/conradsnicta/armadillo-code.git ${WDIR}/arma_tmp > /dev/null 2>&1
mv ${WDIR}/arma_tmp/include/* ${WDIR}/include
rm -rf ${WDIR}/arma_tmp
export ARMA_INCLUDE_PATH="${WDIR}/include"
elif [[ "${{ matrix.config.linalg }}" == "eigen" ]]; then
export OPTIM_TEST_USE_EIGEN="y"
mkdir ${WDIR}/eigen_tmp
git clone --single-branch https://gitlab.com/libeigen/eigen.git ${WDIR}/eigen_tmp > /dev/null 2>&1
mv ${WDIR}/eigen_tmp/* ${WDIR}/include
rm -rf ${WDIR}/eigen_tmp
export EIGEN_INCLUDE_PATH="${WDIR}/include"
else
echo -e " \x1B[31m- error: unrecognized linear algebra library.\033[0m" >&2 ;
echo ""
exit 1
fi
#
git submodule update --init
./configure -c -l ${{ matrix.config.linalg }}
- name: Build
shell: bash
run: make
- name: Tests
shell: bash
working-directory: tests
run: |
WDIR=${PWD}
export CXX=${{ matrix.config.cxx }}
if [[ "${{ matrix.config.linalg }}" == "arma" ]]; then
export OPTIM_TEST_USE_ARMA="y"
elif [[ "${{ matrix.config.linalg }}" == "eigen" ]]; then
export OPTIM_TEST_USE_EIGEN="y"
export EIGEN_INCLUDE_PATH="${WDIR}/../include"
else
echo -e " \x1B[31m- error: unrecognized linear algebra library.\033[0m" >&2 ;
echo ""
exit 1
fi
./setup && ./test_setup/run_cov