-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (40 loc) · 1.28 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
name: Run unit tests
on:
push:
jobs:
unit-tests:
runs-on: ubuntu-20.04
env:
OMPI_VERSION: 4.1.5
steps:
- uses: actions/checkout@v3
# We don't want to build openmpi each time this workflow is
# run. Setup caching of OpenMPI after it is built and installed.
# See "Caching dependencies to speed up workflows" on the GH
# actions docs.
- name: Cache OpenMPI
id: cache-openmpi
uses: actions/cache@v2
with:
path: openmpi-${{ env.OMPI_VERSION }}/installed
key: openmpi-${{ env.OMPI_VERSION }}
- name: Display GCC version number
run: gcc --version
- name: Build openmpi
if: steps.cache-openmpi.outputs.cache-hit != 'true'
run: |
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OMPI_VERSION.tar.gz
tar -xf openmpi-$OMPI_VERSION.tar.gz
cd openmpi-$OMPI_VERSION/ && mkdir installed
./configure --prefix=$(pwd)/installed
make all install
- name: Update PATH
run: |
echo "$GITHUB_WORKSPACE/openmpi-${OMPI_VERSION}/installed/bin" \
>> $GITHUB_PATH
- name: Configure build
run: FC=mpif90 cmake -S . -B build
- name: Build tests
run: make -C build
- name: Run the tests
run: make -C build test