Repository navigation
147 lines (128 loc) · 5.19 KB
/
Copy pathci.yml
File metadata and controls
147 lines (128 loc) · 5.19 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
name: ELEQTRONeX CI
on:
push:
# branches: [development]
paths-ignore:
- Docs
- README.md
- license.txt
pull_request:
branches: [development]
concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-ci
cancel-in-progress: true
jobs:
Build:
runs-on: ${{matrix.os}}
name: OS ${{matrix.os}} - HYPRE ${{matrix.hypre}} - AMReX ${{matrix.amrex_mode}}
strategy:
matrix:
os: [ubuntu-22.04]
hypre: [OFF, ON]
amrex_mode: [internal, external_src]
include:
- os: ubuntu-22.04
install_deps: sudo apt-get install mpich libmpich-dev
comp: gnu
procs: $(nproc)
- hypre: ON
hypre_version: "2.32.0"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Clone AMReX for dependency scripts
run: |
git clone https://github.com/AMReX-Codes/amrex.git ${{runner.workspace}}/amrex
- name: Setup
run: |
# echo "::add-matcher::.github/problem-matchers/gcc.json"
echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV
if [ "${{matrix.amrex_mode}}" == "external_src" ]; then
echo "AMREX_SRC_DIR=${{runner.workspace}}/amrex" >> $GITHUB_ENV
fi
- name: Handle Dependencies
run: |
# Install MPI
${{matrix.install_deps}}
- name: Install CCache
run: ${{runner.workspace}}/amrex/.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v4
with:
path: |
~/.cache/ccache
~/.cache/hypre-${{matrix.hypre_version}}
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: Build Hypre
if: matrix.hypre == 'ON'
run: |
export HYPRE_HOME=~/.cache/hypre-${{matrix.hypre_version}}
if [ ! -d "${HYPRE_HOME}" ]; then
wget -q https://github.com/hypre-space/hypre/archive/refs/tags/v${{matrix.hypre_version}}.tar.gz
tar xfz v${{matrix.hypre_version}}.tar.gz
cd hypre-${{matrix.hypre_version}}/src
./configure --with-cxxstandard=17 --enable-bigint --prefix=${HYPRE_HOME}
make -j ${{matrix.procs}}
make install
cd ../../
fi
echo "HYPRE_ROOT=${HYPRE_HOME}" >> $GITHUB_ENV
- name: Configure CMake
run: |
HYPRE_ARG=""
if [ "${{matrix.hypre}}" == "ON" ]; then
HYPRE_ARG="-DHYPRE_ROOT=${HYPRE_ROOT}"
fi
if [ "${{matrix.amrex_mode}}" == "external_src" ]; then
cmake \
-B${{runner.workspace}}/ELEQTRONeX/build-${{matrix.os}}-${{matrix.hypre}}-${{matrix.amrex_mode}} \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ELEQTRONeX/install \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DELEQTRONeX_MPI:BOOL=ON \
-DELEQTRONeX_EB:BOOL=ON \
-DELEQTRONeX_TRANSPORT:BOOL=ON \
-DELEQTRONeX_TIME_DEPENDENT:BOOL=ON \
-DELEQTRONeX_BROYDEN_PARALLEL:BOOL=ON \
-DELEQTRONeX_HYPRE:BOOL=${{matrix.hypre}} \
${HYPRE_ARG} \
-DELEQTRONeX_amrex_src:PATH=${{env.AMREX_SRC_DIR}} \
${{github.workspace}};
else
cmake \
-B${{runner.workspace}}/ELEQTRONeX/build-${{matrix.os}}-${{matrix.hypre}}-${{matrix.amrex_mode}} \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ELEQTRONeX/install \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DELEQTRONeX_MPI:BOOL=ON \
-DELEQTRONeX_EB:BOOL=ON \
-DELEQTRONeX_TRANSPORT:BOOL=ON \
-DELEQTRONeX_TIME_DEPENDENT:BOOL=ON \
-DELEQTRONeX_BROYDEN_PARALLEL:BOOL=ON \
-DELEQTRONeX_HYPRE:BOOL=${{matrix.hypre}} \
${HYPRE_ARG} \
${{github.workspace}};
fi
- name: Build
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=600M
ccache -z
cmake \
--build ${{runner.workspace}}/ELEQTRONeX/build-${{matrix.os}}-${{matrix.hypre}}-${{matrix.amrex_mode}} \
--parallel ${{env.NPROCS}} \
2>&1 | tee -a ${{runner.workspace}}/build-output-${{matrix.hypre}}-${{matrix.amrex_mode}}.txt;
ccache -s
du -hs ~/.cache/ccache
- name: Report
run: |
egrep "warning:|error:" ${{runner.workspace}}/build-output-${{matrix.hypre}}-${{matrix.amrex_mode}}.txt \
| egrep -v "_deps/.*amrex" | egrep -v "_deps/.*hypre" | egrep -v "${{runner.workspace}}/amrex" | egrep -v "${{runner.workspace}}/hypre" | egrep -v "lto-wrapper: warning:" | sort | uniq \
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings-${{matrix.hypre}}-${{matrix.amrex_mode}}.txt
cat ${{runner.workspace}}/build-output-warnings-${{matrix.hypre}}-${{matrix.amrex_mode}}.txt
export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings-${{matrix.hypre}}-${{matrix.amrex_mode}}.txt | awk '{print $2}')
exit ${return}