Skip to content

Merge pull request #273 from dglaeser/fix/ci-downgrade-compilers-and-… #112

Merge pull request #273 from dglaeser/fix/ci-downgrade-compilers-and-…

Merge pull request #273 from dglaeser/fix/ci-downgrade-compilers-and-… #112

Workflow file for this run

# SPDX-FileCopyrightText: 2022 Dennis Gläser <[email protected]>
# SPDX-License-Identifier: MIT
name: pages
on:
push:
branches: [ main ]
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
permissions:
contents: write
pages: write
jobs:
coverage-and-deploy:
runs-on: ubuntu-22.04
container: dglaeser/gridformat-action-images:full
steps:
- name: checkout-repository
uses: actions/checkout@v2
with:
submodules: true
- name: configure
run: |
rm -rf build
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-12 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-12 \
-DCMAKE_PREFIX_PATH=/gfmt-dependencies \
-DCMAKE_BUILD_TYPE=Debug \
-DGRIDFORMAT_BUILD_TESTS=ON \
-DGRIDFORMAT_DO_COVERAGE=ON \
-DGRIDFORMAT_BUILD_DOCS=ON \
-DGCOV_PATH=/usr/bin/gcov-12 \
-B build
- name: build-doxygen-documentation
run: |
git config --global --add safe.directory $PWD
cd build && make doc_doxygen
mkdir -p public && cp -r docs/doxygen/html/* public
- name: run-coverage
run: |
cd build && make test_coverage
mkdir -p public && cp -r test_coverage public
- name: make-coverage-badge
run: |
echo "import subprocess" > _script.py
echo "percentage = float(open('build/test_coverage.xml').read().split('line-rate=\"')[1].split('\"')[0])*100.0" >> _script.py
echo "color = 'success' if percentage >= 90. else ('yellow' if percentage >= 75. else 'red')" >> _script.py
echo "subprocess.run(['wget', f'https://img.shields.io/badge/coverage-{percentage:.2f}%25-{color}', '-O', 'coverage.svg'], check=True)" >> _script.py
echo "print(f'Overall coverage is: {percentage:.2f}')"
python3 _script.py
cp coverage.svg build/public
- name: deploy-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/public