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