-
Notifications
You must be signed in to change notification settings - Fork 13
165 lines (145 loc) · 5.4 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
163
164
165
name: build
on:
push:
branches:
- exaconstit-dev
- release
pull_request:
# Note the SNLS top dir is no longer where SNLS's source is located within ecmech
# rather it's the top directory of ecmech.
env:
HYPRE_ARCHIVE: v2.26.0.tar.gz
HYPRE_TOP_DIR: hypre-2.26.0
METIS_ARCHIVE: metis-5.1.0.tar.gz
METIS_TOP_DIR: metis-5.1.0
MFEM_TOP_DIR: mfem-exaconstit
ECMECH_TOP_DIR: ecmech
SNLS_TOP_DIR: ecmech
RAJA_TOP_DIR: RAJA
# Note for future improvements:
#
# We cannot reuse cached dependencies and have to build them for each target
# although they could be shared sometimes. That's because Github cache Action
# has no read-only mode. But there is a PR ready for this
# (https://github.com/actions/cache/pull/489)
jobs:
builds-and-tests:
strategy:
matrix:
os: [ubuntu-20.04]
target: [release]
mpi: [parallel]
build-system: [cmake]
name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.mpi }}-${{ matrix.build-system }}
runs-on: ${{ matrix.os }}
steps:
- name: checkout exaconstit
uses: actions/checkout@v2
with:
path: ${{ env.EXACONSTIT_TOP_DIR }}
fetch-depth: 0
# Our tests require python so install it and numpy
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install numpy
# Only get MPI if defined for the job.
# TODO: It would be nice to have only one step, e.g. with a dedicated
# action, but I (@adrienbernede) don't see how at the moment.
- name: get MPI (Linux)
if: matrix.mpi == 'parallel' && matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get install mpich libmpich-dev
export MAKE_CXX_FLAG="MPICXX=mpic++"
# Get RAJA through cache, or build it.
# Install will only run on cache miss.
- name: cache raja
id: raja-cache
if: matrix.mpi == 'parallel'
uses: actions/cache@v2
with:
path: ${{ env.RAJA_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.RAJA_TOP_DIR }}-v2.01
- name: get raja
if: matrix.mpi == 'parallel' && steps.raja-cache.outputs.cache-hit != 'true'
uses: ./.github/workflows/build-raja
with:
raja-dir: ${{ env.RAJA_TOP_DIR }}
# Get ExaCMech through cache, or build it.
# Install will only run on cache miss.
- name: cache ecmech
id: ecmech-cache
if: matrix.mpi == 'parallel'
uses: actions/cache@v2
with:
path: ${{ env.ECMECH_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.ECMECH_TOP_DIR }}-v2.01
- name: get ecmech
if: matrix.mpi == 'parallel' && steps.ecmech-cache.outputs.cache-hit != 'true'
uses: ./.github/workflows/build-ecmech
with:
ecmech-dir: ${{ env.ECMECH_TOP_DIR }}
raja-dir: '${{ github.workspace }}/${{ env.RAJA_TOP_DIR}}/install_dir/lib/cmake/raja/'
# Get Hypre through cache, or build it.
# Install will only run on cache miss.
- name: cache hypre
id: hypre-cache
if: matrix.mpi == 'parallel'
uses: actions/cache@v2
with:
path: ${{ env.HYPRE_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2.01
- name: get hypre
if: matrix.mpi == 'parallel' && steps.hypre-cache.outputs.cache-hit != 'true'
uses: ./.github/workflows/build-hypre
with:
hypre-archive: ${{ env.HYPRE_ARCHIVE }}
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
# Get Metis through cache, or build it.
# Install will only run on cache miss.
- name: cache metis
id: metis-cache
if: matrix.mpi == 'parallel'
uses: actions/cache@v2
with:
path: ${{ env.METIS_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.01
- name: install metis
if: matrix.mpi == 'parallel' && steps.metis-cache.outputs.cache-hit != 'true'
uses: ./.github/workflows/build-metis
with:
metis-archive: ${{ env.METIS_ARCHIVE }}
metis-dir: ${{ env.METIS_TOP_DIR }}
# Get Metis through cache, or build it.
# Install will only run on cache miss.
- name: cache mfem
id: mfem-cache
if: matrix.mpi == 'parallel'
uses: actions/cache@v2
with:
path: ${{ env.MFEM_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.MFEM_TOP_DIR }}-v2.03
- name: install mfem
if: matrix.mpi == 'parallel' && steps.mfem-cache.outputs.cache-hit != 'true'
uses: ./.github/workflows/build-mfem
with:
raja-dir: '${{ github.workspace }}/${{ env.RAJA_TOP_DIR}}/install_dir/'
hypre-dir: '${{ github.workspace }}/${{ env.HYPRE_TOP_DIR }}/src/hypre/'
metis-dir: '${{ github.workspace }}/${{ env.METIS_TOP_DIR }}/install_dir/'
mfem-dir: ${{ env.MFEM_TOP_DIR }}
# ExaConstit build and test
- name: build
uses: ./.github/workflows/build-exaconstit
with:
raja-dir: '${{ github.workspace }}/${{ env.RAJA_TOP_DIR}}/install_dir/lib/cmake/raja/'
mfem-dir: '${{ github.workspace }}/${{ env.MFEM_TOP_DIR }}/install_dir/lib/cmake/mfem/'
ecmech-dir: '${{ github.workspace }}/${{ env.ECMECH_TOP_DIR }}/install_dir/'
snls-dir: '${{ github.workspace }}/${{ env.SNLS_TOP_DIR }}/install_dir/'
- name: cmake unit tests
if: matrix.build-system == 'cmake'
run: |
cd ${{ github.workspace }}/build/ && ctest --output-on-failure