@@ -4,58 +4,58 @@ description: 'Process coverage data'
44runs :
55 using : " composite"
66 steps :
7- - name : " Build io and profiling packages if necessary"
8- shell : bash
9- run : |
10- # the following somewhat awkward `cd` invocation ensures
11- # compatibility with both GAP <= 4.11 (with package dir names like
12- # `pkg/io-1.2.3`) and GAP >= 4.12 (where it is `pkg/io`)
13- cd $GAPROOT/pkg/io || cd $GAPROOT/pkg/io-*
14- if [[ ! -f config.status ]] ; then
15- ./configure --with-gaproot=$GAPROOT
16- fi
17- make -j$(nproc)
7+ - name : " Build io and profiling packages if necessary"
8+ shell : bash
9+ run : |
10+ # the following somewhat awkward `cd` invocation ensures
11+ # compatibility with both GAP <= 4.11 (with package dir names like
12+ # `pkg/io-1.2.3`) and GAP >= 4.12 (where it is `pkg/io`)
13+ cd $GAPROOT/pkg/io || cd $GAPROOT/pkg/io-*
14+ if [[ ! -f config.status ]] ; then
15+ ./configure --with-gaproot=$GAPROOT
16+ fi
17+ make -j$(nproc)
1818
19- cd $GAPROOT/pkg/profiling || cd $GAPROOT/pkg/profiling-*
20- if [[ ! -f Makefile ]] ; then
21- if [[ -f configure.ac ]] ; then
22- ./configure --with-gaproot=$GAPROOT
23- else
24- ./configure $GAPROOT
25- fi
26- fi
27- make -j$(nproc)
19+ cd $GAPROOT/pkg/profiling || cd $GAPROOT/pkg/profiling-*
20+ if [[ ! -f Makefile ]] ; then
21+ if [[ -f configure.ac ]] ; then
22+ ./configure --with-gaproot=$GAPROOT
23+ else
24+ ./configure $GAPROOT
25+ fi
26+ fi
27+ make -j$(nproc)
2828
29- - name : " Process coverage data"
30- shell : bash
31- run : |
32- # generate library coverage reports
33- $GAP -q <<GAPInput
34- if LoadPackage("profiling") <> true then
35- Print("ERROR: could not load profiling package");
36- FORCE_QUIT_GAP(1);
37- fi;
38- d := Directory("coverage");
39- covs := [];
40- files := DirectoryContents(d);
41- if files = fail then
42- Print("no coverage data found\n ");
43- QUIT_GAP(0);
44- fi;
45- for f in files do
46- if f in [".", ".."] then continue; fi;
47- Add(covs, Filename(d, f));
48- od;
49- Print("Merging coverage results from ", covs, "\n");
50- r := MergeLineByLineProfiles(covs);;
51- # filtered out unwanted other packages to avoid bad coverage interaction
52- r.line_info := Filtered(r.line_info, x -> not StartsWith( x[1], "$GAPROOT/" ) );;
53- Print("Outputting JSON\n");
54- OutputJsonCoverage(r, "gap-coverage.json");
55- QUIT_GAP(0);
56- GAPInput
29+ - name : " Process coverage data"
30+ shell : bash
31+ run : |
32+ # generate library coverage reports
33+ $GAP -q <<GAPInput
34+ if LoadPackage("profiling") <> true then
35+ Exec("echo \"::error::Could not load profiling package\" ");
36+ FORCE_QUIT_GAP(1);
37+ fi;
38+ d := Directory("coverage");
39+ covs := [];
40+ files := DirectoryContents(d);
41+ if files = fail then
42+ Exec("echo \"::warning::No coverage data found\" ");
43+ QUIT_GAP(0);
44+ fi;
45+ for f in files do
46+ if f in [".", ".."] then continue; fi;
47+ Add(covs, Filename(d, f));
48+ od;
49+ Print("Merging coverage results from ", covs, "\n");
50+ r := MergeLineByLineProfiles(covs);;
51+ # filtered out unwanted other packages to avoid bad coverage interaction
52+ r.line_info := Filtered(r.line_info, x -> not StartsWith( x[1], "$GAPROOT/" ) );;
53+ Print("Outputting JSON\n");
54+ OutputJsonCoverage(r, "gap-coverage.json");
55+ QUIT_GAP(0);
56+ GAPInput
5757
58- - name : " generate source coverage reports by running gcov"
59- shell : bash
60- run : |
61- find . -type f -name '*.gcno' -exec gcov -pb {} +
58+ - name : " generate source coverage reports by running gcov"
59+ shell : bash
60+ run : |
61+ find . -type f -name '*.gcno' -exec gcov -pb {} +
0 commit comments