Skip to content

Reindent code

Reindent code #211

name: Compile And Run Unit Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [[ubuntu-latest]] # Only ubuntu for now because of mkl
steps:
- uses: actions/checkout@v2
# ========= Create build directory =========
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commandss
run: cmake -E make_directory ${{github.workspace}}/build
# ========= Install MKL =========
- name: Intel Apt repository
timeout-minutes: 1
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl-devel ninja-build
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
# ========= Install Log4cxx =========
- name: Intel Apt repository
run: sudo apt-get install -y liblog4cxx-dev
# ========= Install NeoPZ =========
- name: Clone External NeoPZ
uses: actions/checkout@v2
with:
path: ./neopz
repository: labmec/neopz
ref: develop
- name: Set up build environment for External NeoPZ
shell: bash
working-directory: ${{github.workspace}}/neopz
run: cmake -E make_directory build
- name: Configure CMake External NeoPZ
shell: bash
working-directory: ${{github.workspace}}/neopz/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSING_MKL=ON -DUSING_LOG4CXX=ON -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/neopz_install
- name: Build And Install External NeoPZ
working-directory: ${{github.workspace}}/neopz/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install GMSH =========
- name: Clone External GMSH
run: (rm -rf ${{github.workspace}}/gmsh || echo "gmsh folder will be created on clone...") && git clone https://gitlab.onelab.info/gmsh/gmsh.git ${{github.workspace}}/gmsh
- name: Set up build environment for External GMSH
shell: bash
working-directory: ${{github.workspace}}/gmsh
run: cmake -E make_directory build
- name: Configure CMake External GMSH
shell: bash
working-directory: ${{github.workspace}}/gmsh/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gmsh_install -DENABLE_BUILD_SHARED=ON
- name: Build And Install External GMSH
working-directory: ${{github.workspace}}/gmsh/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install DFNMesh =========
- name: Clone External DFNMesh
uses: actions/checkout@v2
with:
path: ./dfnmesh
repository: labmec/dfnMesh
ref: master
- name: Set up build environment for External DFNMesh
shell: bash
working-directory: ${{github.workspace}}/dfnmesh
run: cmake -E make_directory build
- name: Configure CMake External DFNMesh
shell: bash
working-directory: ${{github.workspace}}/dfnmesh/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dfnmesh_install
- name: Build And Install External DFNMesh
working-directory: ${{github.workspace}}/dfnmesh/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install Eigen3 =========
- name: Clone External Eigen3
shell: bash
working-directory: ${{github.workspace}}
run: git clone https://gitlab.com/libeigen/eigen.git
- name: Change Branch of External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen
run: git checkout 3.3
- name: Set up build environment for External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen
run: cmake -E make_directory build
- name: Configure CMake External Eigen3
shell: bash
working-directory: ${{github.workspace}}/eigen/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/eigen_install
- name: Build And Install External Eigen3
working-directory: ${{github.workspace}}/eigen/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Install Boost =========
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.73.0
platform_version: 18.04
# ========= Install LibInterpolate =========
- name: Clone External libInterpolate
uses: actions/checkout@v2
with:
path: ./libinterpolate
repository: CD3/libInterpolate
ref: master
- name: Set up build environment for External libinterpolate
shell: bash
working-directory: ${{github.workspace}}/libinterpolate
run: cmake -E make_directory build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Configure CMake External libinterpolate
shell: bash
working-directory: ${{github.workspace}}/libinterpolate/build
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/libinterpolate_install
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build And Install External libinterpolate
working-directory: ${{github.workspace}}/libinterpolate/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
env:
MAKEFLAGS: "-j4"
# ========= Build iMRS =========
- name: Configure iMRS CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_UNITTESTING=ON -DUSING_DFN=ON
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build iMRS
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
env:
MAKEFLAGS: "-j4"
# ========= Run Unit Tests =========
- name: Run Unit Tests
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
env:
CTEST_OUTPUT_ON_FAILURE: 1