Skip to content

coverage: remove nvidia dir #349

coverage: remove nvidia dir

coverage: remove nvidia dir #349

Workflow file for this run

name: run-coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 8 * * *' #every day at 8am
jobs:
runCoverage:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [g++]
language: ['cpp']
build_type: [Debug]
# Permissions needed for coverage paste
permissions:
#security-events: write
pull-requests: write
steps:
- name: Install system dependencies
run: |
sudo apt-get update -yq
sudo apt-get install -yq cmake
sudo apt-get install -yq doxygen
sudo apt-get install -yq graphviz
sudo apt-get install -yq libhdf5-mpi-dev
sudo apt-get install -yq lcov
## Build
- name: Build meshfields
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PROCS: 4
id: build
shell: bash
run: |
# debug info
lcov --version
lsb_release -a
echo "github.workspace ${{github.workspace}}"
workDir=${{github.workspace}}/meshfields
mkdir -p $workDir
echo "MESHFIELDS_WORK_DIR=$(echo $workDir)" >> $GITHUB_ENV
echo "workDir $workDir"
# kokkos
git clone -b develop https://github.com/kokkos/kokkos.git ${workDir}/kokkos
kkbdir=${workDir}/build-kokkos
cmake -S ${workDir}/kokkos -B $kkbdir \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=g++ \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=off \
-DKokkos_ENABLE_DEBUG=on \
-DCMAKE_INSTALL_PREFIX=$kkbdir/install
cmake --build $kkbdir --target install -j ${PROCS}
# cabana
git clone https://github.com/ECP-copa/Cabana.git ${workDir}/cabana
cabbdir=${workDir}/build-cab
cmake -S ${workDir}/cabana -B $cabbdir \
-DCMAKE_BUILD_TYPE="Debug" \
-DCMAKE_CXX_COMPILER=g++ \
-DKokkos_ROOT=$kkbdir/install \
-DCabana_ENABLE_MPI=OFF \
-DCabana_ENABLE_CAJITA=OFF \
-DCabana_ENABLE_TESTING=OFF \
-DCabana_ENABLE_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX=$cabbdir/install
cmake --build $cabbdir -j ${PROCS} --target install
# omegah
git clone https://github.com/SCOREC/omega_h.git ${workDir}/omegah
ohbdir=${workDir}/build-omegah
cmake -S ${workDir}/omegah -B $ohbdir \
-DCMAKE_INSTALL_PREFIX=$ohbdir/install \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=off \
-DOmega_h_USE_Kokkos=on \
-DKokkos_PREFIX=$kkbdir/install
cmake --build $ohbdir -j ${PROCS} --target install
# meshfields
git clone -b $BRANCH_NAME https://github.com/SCOREC/meshfields.git ${workDir}/meshfields
mfbdir=${workDir}/build-meshfields
cmake -S ${workDir}/meshfields -B $mfbdir \
-DCMAKE_BUILD_TYPE=Debug \
-DOmega_h_ROOT=$ohbdir/install \
-DKokkos_ROOT=$kkbdir/install \
-DCabana_ROOT=$cabbdir/install \
-DmeshFields_ENABLE_COVERAGE_BUILD=ON \
-DLCOV_SYSTEM_EXCLUDE_PATHS="/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/ompi/mpi/cxx/*\;/usr/include/*"
pushd $mfbdir
make -j ${PROCS}
make coverage -j ${PROCS}
popd
# convert lcov to cobertura and exclude dependencies
pip install lcov_cobertura
lcov_cobertura ${mfbdir}/coverage.info -e meshfields.build-kokkos.install.include -e meshfields.build-omegah.install.include
#Uploads coverage directory with lcov generated HTML
- name: Upload lcov report
uses: actions/upload-artifact@v4
with:
name: coverage
path: ${{github.workspace}}/meshfields/build-meshFields/coverage
# Generate a report readable from console -------------------------------------
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: coverage.xml
format: markdown
output: both
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md