1+ name : Coverage
2+
3+ on :
4+ workflow_dispatch :
5+ workflow_call :
6+
7+ permissions :
8+ contents : read
9+
10+ env :
11+ CLASSPATH : " :/usr/lib/opensourcecobol4j/libcobj.jar"
12+
13+ jobs :
14+ build :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - uses : actions/setup-java@v4
19+ with :
20+ distribution : ' temurin'
21+ java-version : ' 21'
22+
23+ - name : Install dependencies on Ubuntu
24+ run : |
25+ sudo apt-get update -y
26+ sudo apt-get install -y build-essential gettext autoconf bison flex gcovr
27+
28+ - name : Checkout opensource COBOL 4J
29+ uses : actions/checkout@v4
30+
31+ - name : Install opensource COBOL 4J
32+ run : |
33+ ./configure --prefix=/usr/ CFLAGS='-fprofile-arcs -ftest-coverage'
34+ make
35+ sudo make install
36+
37+ - name : Run NIST test
38+ working-directory : tests/cobol85
39+ run : make test || true
40+
41+ - name : Run other tests
42+ working-directory : tests
43+ run : |
44+ tests=("command-line-options" "data-rep" "i18n_sjis" "jp-compat" "run" "syntax" "cobj-idx" "misc")
45+ for test in "${tests[@]}"; do
46+ ./"$test" || true
47+ done
48+
49+ - name : Generate a coverage report
50+ working-directory : cobj
51+ run : |
52+ gcov -l ./*.gcda
53+ gcovr -r . \
54+ -e cobj-parser -e cobj-scanner -e cobj-pplex -e cobj-ppparse \
55+ -e parser.c -e parser.y -e scanner.l -e scanner.c -e pplex.l -e pplex.c -e ppparse.y -e ppparse.c \
56+ -e flag-help.def -e warning-help.def -e warning.def \
57+ --html-details --html-self-contained --html -o report.html --txt-metric=branch
58+ mkdir -p coverage-report
59+ cp ./*.html coverage-report
60+
61+ - name : Archive a coverage report
62+ uses : actions/upload-artifact@v4
63+ with :
64+ name : code-coverage-report
65+ path : cobj/coverage-report/
0 commit comments