-
Notifications
You must be signed in to change notification settings - Fork 59
111 lines (97 loc) · 3.19 KB
/
build-and-test.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
name: build-and-test-laghos
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
HYPRE_ARCHIVE: v2.11.2.tar.gz
HYPRE_TOP_DIR: hypre-2.11.2
METIS_ARCHIVE: metis-4.0.3.tar.gz
METIS_TOP_DIR: metis-4.0.3
MFEM_TOP_DIR: mfem
MFEM_BRANCH: master
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
# Checkout Laghos in "laghos" subdirectory. Final path: /home/runner/work/ceed/laghos/laghos
# Note: it must be done now to access "install-hypre", "install-metis" and "install-mfem" actions.
- name: checkout Laghos
uses: actions/checkout@v2
with:
path: laghos
- name: get MPI (Linux)
run: |
sudo apt-get install mpich libmpich-dev
export MAKE_CXX_FLAG="MPICXX=mpic++"
# Get Hypre through cache, or build it.
# Install will only run on cache miss.
- name: cache Hypre
id: hypre-cache
uses: actions/cache@v2
with:
path: ${{ env.HYPRE_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2
- name: build Hypre
if: steps.hypre-cache.outputs.cache-hit != 'true'
uses: mfem/github-actions/[email protected]
with:
archive: ${{ env.HYPRE_ARCHIVE }}
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
uses: actions/cache@v2
with:
path: ${{ env.METIS_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2
- name: build Metis
if: steps.metis-cache.outputs.cache-hit != 'true'
uses: mfem/github-actions/[email protected]
with:
archive: ${{ env.METIS_ARCHIVE }}
dir: ${{ env.METIS_TOP_DIR }}
# make generic links to libraries for MFEM install
# Those links are already created by build-mfem action, but not when the cache is used...
- name: configure links
run: |
echo "Hypre symlink:"
ln -s $HYPRE_TOP_DIR hypre;
echo "Metis symlink:"
ln -s $METIS_TOP_DIR metis-4.0;
- name: MFEM ${{ env.MFEM_BRANCH }} commit
run: |
echo "MFEM_COMMIT=$(git ls-remote --heads https://github.com/mfem/mfem.git ${{ env.MFEM_BRANCH }} | awk '{print $1;}')" >> $GITHUB_ENV
# Get MFEM through cache, or build it.
# Install will only run on cache miss.
- name: cache MFEM
id: mfem-cache
uses: actions/cache@v2
with:
path: ${{ env.MFEM_TOP_DIR }}
key: ${{ runner.os }}-build-${{ env.MFEM_TOP_DIR }}-${{ env.MFEM_COMMIT }}-v3
- name: build MFEM
if: steps.mfem-cache.outputs.cache-hit != 'true'
uses: mfem/github-actions/[email protected]
with:
os: ${{ runner.os }}
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
metis-dir: ${{ env.METIS_TOP_DIR }}
mfem-dir: ${{ env.MFEM_TOP_DIR }}
mfem-branch: ${{ env.MFEM_BRANCH }}
- name: build Laghos
run: |
cd laghos && make -j
- name: check Laghos 1 proc
run: |
cd laghos && make checks ranks=1
- name: check Laghos 2 procs
run: |
cd laghos && make checks ranks=2
- name: test Laghos
run: |
cd laghos && make tests