Skip to content

make checkstyle

make checkstyle #1656

Workflow file for this run

# This file is part of GUFI, which is part of MarFS, which is released
# under the BSD license.
#
#
# Copyright (c) 2017, Los Alamos National Security (LANS), LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# From Los Alamos National Security, LLC:
# LA-CC-15-039
#
# Copyright (c) 2017, Los Alamos National Security, LLC All rights reserved.
# Copyright 2017. Los Alamos National Security, LLC. This software was produced
# under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National
# Laboratory (LANL), which is operated by Los Alamos National Security, LLC for
# the U.S. Department of Energy. The U.S. Government has rights to use,
# reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR LOS
# ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
# ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is
# modified to produce derivative works, such modified software should be
# clearly marked, so as not to confuse it with the version available from
# LANL.
#
# THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
# OF SUCH DAMAGE.
name: Codecov
on: [push, pull_request]
env:
CC: gcc
CXX: g++
CXXFLAGS: -std=c++11 # required for tests to function
DEP_INSTALL_PREFIX: ~/.local
COMMON_CONFIG: -DDEP_INSTALL_PREFIX="${DEP_INSTALL_PREFIX}" -DDEP_BUILD_THREADS=2 -DENABLE_SUDO_TESTS=On -DGCOV=On -DCMAKE_BUILD_TYPE=Debug -DPRINT_CUMULATIVE_TIMES=On -DPRINT_PER_THREAD_STATS=On -DPRINT_QPTPOOL_QUEUE_SIZE=On
jobs:
CodeCoverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ${{ env.DEP_INSTALL_PREFIX }}
key: ${{ runner.os }}-CodeCoverage
- name: Ubuntu 20.04 Prerequisites
run: sudo contrib/CI/ubuntu.sh
- name: Install matplotlib
run: |
sudo apt -y install python3-pip
python3 -m pip install matplotlib
- name: Coverage Prerequisites
run: |
sudo apt install gcovr
sudo apt install g++
python3 -m pip install coverage
python3 -m pip install pytest
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build ${{ env.COMMON_CONFIG }}
- name: Build
run: cmake --build ${{ github.workspace }}/build -j
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest || true
- name: Delete files not reported for coverage
run: find -name "*.gc*" -a \( -name "gendir.*" -o -name "make_testindex.*" -o -name "bffuse.*" -o -name "bfresultfuse.*" -o -name "bfwreaddirplus2db.*" -o -name "dfw.*" -o -name "parallel_rmr.*" -o -name "tsmepoch2time.*" -o -name "tsmtime2epoch.*" -o -path "*/test/*" \) -delete
- name: Generate Python Coverage Report
run: |
export PYTHONPATH="${{ github.workspace }}/build/contrib:${{ github.workspace }}/build/contrib/performance:${{ github.workspace }}/build/scripts:${PYTHONPATH}"
coverage run -m pytest \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/extraction.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/graph.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/hash.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/stats.py \
${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/utils.py \
${{ github.workspace }}/build/test/unit/python/test_gufi_common.py \
${{ github.workspace }}/build/test/unit/python/test_gufi_config.py
export GUFI_PYTHON_TEST_COVERAGE="coverage run -a"
(${{ github.workspace }}/build/test/regression/gufi_find.sh || true) > /dev/null 2>&1
(${{ github.workspace }}/build/test/regression/gufi_getfattr.sh || true) > /dev/null 2>&1
(${{ github.workspace }}/build/test/regression/gufi_ls.sh || true) > /dev/null 2>&1
(${{ github.workspace }}/build/test/regression/gufi_stat.sh || true) > /dev/null 2>&1
(${{ github.workspace }}/build/test/regression/gufi_stats.sh || true) > /dev/null 2>&1
coverage xml --omit="${{ github.workspace }}/build/contrib/hashes.py,${{ github.workspace }}/build/contrib/performance/performance_pkg/tests/*,${{ github.workspace }}/build/test/*,${{ github.workspace }}/build/test/regression/*,${{ github.workspace }}/build/test/unit/python/*"
rm .coverage # If not removed, codecov will attempt to run coverage xml which will not account for our omissions
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
gcov: true
fail_ci_if_error: true