From 20fa47f006e21f14b956c89feef26f0af5e110f1 Mon Sep 17 00:00:00 2001 From: Alexis Montoison <35051714+amontoison@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:18:14 -0600 Subject: [PATCH] [CI] Add a workflow for the code coverage (#356) * [CI] Add a workflow for the code coverage * Update coverage.yml * Also exclude test files in C --- .github/coverage/exclude_files.txt | 253 +++++++++++++++++++++++++++++ .github/workflows/coverage.yml | 70 ++++++++ 2 files changed, 323 insertions(+) create mode 100644 .github/coverage/exclude_files.txt create mode 100644 .github/workflows/coverage.yml diff --git a/.github/coverage/exclude_files.txt b/.github/coverage/exclude_files.txt new file mode 100644 index 0000000000..12c09a8dab --- /dev/null +++ b/.github/coverage/exclude_files.txt @@ -0,0 +1,253 @@ +src/amd/amdt.F90 +src/arc/arct.F90 +src/arc/arcti.F90 +src/bgo/bgot.F90 +src/bgo/bgoti.F90 +src/blls/bllst.F90 +src/blls/bllsti.F90 +src/bllsb/bllsbt.F90 +src/bllsb/bllsbti.F90 +src/bnls/bnlst.F90 +src/bnls/bnlst2.F90 +src/bnls/bnlsti.F90 +src/bqp/bqpt.F90 +src/bqp/bqpti.F90 +src/bqpb/bqpbt.F90 +src/bqpb/bqpbti.F90 +src/bsc/bsct.F90 +src/ccqp/ccqpt.F90 +src/ccqp/ccqpti.F90 +src/cdqp/cdqpt.F90 +src/check/checkt.F90 +src/clls/cllst.F90 +src/clls/cllsti.F90 +src/convert/convertt.F90 +src/cqp/cqpt.F90 +src/cqp/cqpti.F90 +src/cro/crot.F90 +src/cro/croti.F90 +src/dgo/dgot.F90 +src/dgo/dgoti.F90 +src/dlp/dlpt.F90 +src/dps/dpst.F90 +src/dqp/dqpt.F90 +src/dqp/dqpti.F90 +src/eqp/eqpt.F90 +src/eqp/eqpti.F90 +src/external/mkl_pardiso/mkl_pardisot.F90 +src/external/mumps/mumpst.F90 +src/external/pardiso/pardisot.F90 +src/external/pastix/pastixt.F90 +src/external/wsmp/wsmpt.F90 +src/fdc/fdct.F90 +src/fdc/fdcti.F90 +src/fdh/fdht.F90 +src/filtrane/filtranet.F90 +src/fit/fitt.F90 +src/glrt/glrtt.F90 +src/glrt/glrtti.F90 +src/gls/glst.F90 +src/gltr/gltrt.F90 +src/gltr/gltrti.F90 +src/hash/hasht.F90 +src/icfs/icfst.F90 +src/ir/irt.F90 +src/l1qp/l1qpt.F90 +src/l2rt/l2rtt.F90 +src/l2rt/l2rtti.F90 +src/lancelot/lancelott.F90 +src/lancelot_simple/lancelot_simplet.F90 +src/lhs/lhst.F90 +src/llsr/llsrt.F90 +src/llsr/llsrti.F90 +src/llst/llstt.F90 +src/llst/llstti.F90 +src/lms/lmst.F90 +src/lpa/lpat.F90 +src/lpa/lpati.F90 +src/lpb/lpbt.F90 +src/lpb/lpbti.F90 +src/lqr/lqrt.F90 +src/lqt/lqtt.F90 +src/lqt/lqtt2.F90 +src/lsp/lspt.F90 +src/lsqp/lsqpt.F90 +src/lsqp/lsqpti.F90 +src/lsrt/lsrtt.F90 +src/lsrt/lsrtti.F90 +src/lstr/lstrt.F90 +src/lstr/lstrti.F90 +src/miqr/miqrt.F90 +src/mop/mopt.F90 +src/nlpt/nlptt.F90 +src/nls/nlst.F90 +src/nls/nlst2.F90 +src/nls/nlsti.F90 +src/presolve/presolvet.F90 +src/presolve/presolveti.F90 +src/psls/pslst.F90 +src/psls/pslsti.F90 +src/qp/qpt.F90 +src/qpa/qpat.F90 +src/qpa/qpati.F90 +src/qpb/qpbt.F90 +src/qpb/qpbti.F90 +src/qpc/qpct.F90 +src/qpp/qppt.F90 +src/qpt/qptt.F90 +src/rand/randt.F90 +src/roots/rootst.F90 +src/rpd/rpdt.F90 +src/rpd/rpdti.F90 +src/rqs/rqst.F90 +src/rqs/rqsti.F90 +src/sbls/sblst.F90 +src/sbls/sblsti.F90 +src/scale/scalet.F90 +src/scu/scut.F90 +src/sec/sect.F90 +src/sha/shat.F90 +src/sha/shati.F90 +src/sils/silst.F90 +src/slls/sllst.F90 +src/slls/sllsti.F90 +src/sls/slst.F90 +src/sls/slsti.F90 +src/smt/smtt.F90 +src/sort/sortt.F90 +src/ssids/ssidst.F90 +src/svt/svtt.F90 +src/trb/trbt.F90 +src/trb/trbti.F90 +src/trs/trst.F90 +src/trs/trsti.F90 +src/tru/trut.F90 +src/tru/truti.F90 +src/ugo/ugot.F90 +src/uls/ulst.F90 +src/uls/ulsti.F90 +src/version/versiont.F90 +src/wcp/wcpt.F90 +src/wcp/wcpti.F90 +src/arc/C/arct.c +src/arc/C/arctf.c +src/bgo/C/bgot.c +src/bgo/C/bgotf.c +src/blls/C/bllst.c +src/blls/C/bllstf.c +src/bllsb/C/bllsbt.c +src/bllsb/C/bllsbtf.c +src/bnls/C/bnlst.c +src/bnls/C/bnlstf.c +src/bqp/C/bqpt.c +src/bqp/C/bqptf.c +src/bqpb/C/bqpbt.c +src/bqpb/C/bqpbtf.c +src/ccqp/C/ccqpt.c +src/ccqp/C/ccqptf.c +src/clls/C/cllst.c +src/clls/C/cllstf.c +src/cqp/C/cqpt.c +src/cqp/C/cqptf.c +src/cro/C/crot.c +src/cro/C/crotf.c +src/dgo/C/dgot.c +src/dgo/C/dgotf.c +src/dps/C/dpst.c +src/dps/C/dpstf.c +src/dqp/C/dqpt.c +src/dqp/C/dqpt2.c +src/dqp/C/dqptf.c +src/eqp/C/eqpt.c +src/eqp/C/eqptf.c +src/fdc/C/fdct.c +src/fdc/C/fdctf.c +src/glrt/C/glrtt.c +src/gltr/C/gltrt.c +src/l2rt/C/l2rtt.c +src/lhs/C/lhst.c +src/llsr/C/llsrt.c +src/llsr/C/llsrtf.c +src/llst/C/llstt.c +src/llst/C/llsttf.c +src/lpa/C/lpat.c +src/lpa/C/lpatf.c +src/lpb/C/lpbt.c +src/lpb/C/lpbtf.c +src/lsqp/C/lsqpt.c +src/lsqp/C/lsqptf.c +src/lsrt/C/lsrtt.c +src/lstr/C/lstrt.c +src/metis/adapter.c +src/metis/auxapi.c +src/metis/balance.c +src/metis/bucketsort.c +src/metis/checkgraph.c +src/metis/coarsen.c +src/metis/compress.c +src/metis/contig.c +src/metis/debug.c +src/metis/error.c +src/metis/fm.c +src/metis/fortran.c +src/metis/fs.c +src/metis/gklib.c +src/metis/gkregex.c +src/metis/graph.c +src/metis/initpart.c +src/metis/io.c +src/metis/kwayfm.c +src/metis/kwayrefine.c +src/metis/mcore.c +src/metis/mcutil.c +src/metis/memory.c +src/metis/minconn.c +src/metis/mincover.c +src/metis/mmd.c +src/metis/ometis.c +src/metis/options.c +src/metis/random.c +src/metis/refine.c +src/metis/separator.c +src/metis/sfm.c +src/metis/srefine.c +src/metis/string.c +src/metis/test_nodend.c +src/metis/timers.c +src/metis/timing.c +src/metis/util.c +src/metis/wspace.c +src/nls/C/nlst.c +src/nls/C/nlstf.c +src/presolve/C/presolvet.c +src/presolve/C/presolvetf.c +src/psls/C/pslst.c +src/psls/C/pslstf.c +src/qpa/C/qpat.c +src/qpa/C/qpatf.c +src/qpb/C/qpbt.c +src/qpb/C/qpbtf.c +src/rpd/C/rpdt.c +src/rpd/C/rpdtf.c +src/rqs/C/rqst.c +src/rqs/C/rqstf.c +src/sbls/C/sblst.c +src/sbls/C/sblstf.c +src/sha/C/shat.c +src/sha/C/shatf.c +src/slls/C/sllst.c +src/slls/C/sllstf.c +src/sls/C/slst.c +src/sls/C/slstf.c +src/trb/C/trbt.c +src/trb/C/trbtf.c +src/trs/C/trst.c +src/trs/C/trstf.c +src/tru/C/trut.c +src/tru/C/trutf.c +src/ugo/C/ugot.c +src/uls/C/ulst.c +src/uls/C/ulstf.c +src/version/C/versiont.c +src/wcp/C/wcpt.c +src/wcp/C/wcptf.c diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..378bde7ece --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,70 @@ +name: Coverage +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y ninja-build gcc gfortran lcov libhwloc-dev + pip install meson gcovr + + - name: Set the environment variables + shell: bash + run: | + echo "GALAHAD=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Set environment variables for OpenMP + shell: bash + run: | + echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV + echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV + + - name: Setup + run: | + meson setup builddir --buildtype=debug \ + -Db_coverage=true \ + -Dsingle=true \ + -Ddouble=true \ + -Dquadruple=true \ + -Dtests=true + + - name: Compilation + run: | + meson compile -C builddir + + - name: Tests + run: meson test -C builddir --timeout-multiplier 8 + + - name: Generate coverage report + run: | + EXCLUDE_FILES=$(paste -sd "|" .github/coverage/exclude_files.txt) + gcovr -r . --xml -o builddir/coverage.xml --exclude "$EXCLUDE_FILES" + # gcovr -r . --html --html-details -o builddir/coverage.html --exclude "$EXCLUDE_FILES" + + # - name: Upload coverage report to GitHub + # uses: actions/upload-artifact@v4 + # with: + # name: coverage-report + # path: builddir/coverage.html + + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v5 + with: + files: builddir/coverage.xml + token: ${{ secrets.CODECOV_TOKEN }}