Codecov Scan #2668
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Codecov Scan | |
on: | |
schedule: | |
- cron: '24 0 * * *' | |
pull_request: | |
branches: [ main, dev/cea ] | |
paths-ignore: | |
- '**.css' | |
- '**.dox' | |
- '**.doxyfile' | |
- '**.geo' | |
- '**.goto' | |
- '**.html' | |
- '**.jpg' | |
- '**.js' | |
- '**.markdown' | |
- '**.md' | |
- '**.odg' | |
- '**.old' | |
- '**.png' | |
- '**.py' | |
- '**.samples' | |
- '**.svg' | |
- '**.webp' | |
- '**.yml' | |
workflow_dispatch: | |
env: | |
# CTest | |
CT_OPTS: "--timeout 300 --output-on-failure" | |
EXCLUDED_TESTS: '' | |
EXCLUDED_TESTS_WITH_LABELS: 'LARGE_HYBRID' | |
# OpenMPI | |
OMPI_ALLOW_RUN_AS_ROOT: 1 | |
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | |
jobs: | |
build: | |
name: Codecov | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/arcaneframework/ubuntu-2204:gcc-12_clang-16_full_20230808 | |
steps: | |
# On place la source à la racine pour éviter | |
# un sous-répertoire en plus dans Codecov. | |
- name: Define environment paths | |
shell: bash | |
run: | | |
echo "SOURCE_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV | |
echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV | |
echo "LOG_DIR=${GITHUB_WORKSPACE}/log" >> $GITHUB_ENV | |
echo "CT_RESULT_DIR=${GITHUB_WORKSPACE}/test" >> $GITHUB_ENV | |
- name: Get date | |
shell: bash | |
run: echo "m_date=$(/bin/date -u '+%Y%m%d%H%M%S')" >> $GITHUB_ENV | |
- name: Checkout framework | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.SOURCE_DIR }} | |
submodules: true | |
- name: Build framework | |
uses: arcaneframework/gh_actions/build_install_framework@v1 | |
with: | |
source_dir: ${{ env.SOURCE_DIR }} | |
build_dir: ${{ env.BUILD_DIR }} | |
cmake_additionnal_args: '-DCMAKE_CXX_FLAGS_RELEASE="-O2 -g --coverage -fprofile-abs-path -ftest-coverage" | |
-DARCANE_DEFAULT_PARTITIONER=Metis | |
-DARCANE_DISABLE_PERFCOUNTER_TESTS=ON | |
-DARCANE_DISABLE_HYODA=TRUE | |
-DARCCON_REGISTER_PACKAGE_VERSION=2' | |
type_build: 'Release' | |
compilo: 'GCC' | |
verbose: true | |
with_cuda: false | |
with_samples: false | |
- name: Upload failure artifact | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: codecov-failure_config_build-artifact | |
path: ${{ env.LOG_DIR }} | |
retention-days: 7 | |
- name: Test | |
shell: bash | |
run: | | |
mkdir -p ${{ env.CT_RESULT_DIR }} | |
ARCANE_CHECK=1 ctest --test-dir ${{ env.BUILD_DIR }} --output-junit ${{ env.CT_RESULT_DIR }}/results.xml ${{ env.CT_OPTS }} -E '${{ env.EXCLUDED_TESTS }}' -LE '${{ env.EXCLUDED_TESTS_WITH_LABELS }}' | |
- name: Apply coverage | |
shell: bash | |
continue-on-error: true | |
run: | | |
gcov -p $(find . -name "*.gcno" -o -name "*.gcda") | |
- name: Remove gcov files for generated axl .h and generated wrap files | |
shell: bash | |
run: | | |
rm -v -f *_axl.h.gcov *_wrap.*.gcov | |
- name: Upload coverage files to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
verbose: true | |
fail_ci_if_error: true | |
- name: Upload test artifact | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: codecov-test-artifact | |
path: ${{ env.CT_RESULT_DIR }} | |
retention-days: 7 |