Skip to content

Merge pull request #5 from semi-h/basics #9

Merge pull request #5 from semi-h/basics

Merge pull request #5 from semi-h/basics #9

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: cmake -S . -B build
- name: Build tests
run: make -C build
- name: Run the tests
run: make -C build test