Skip to content

Commit 3325489

Browse files
add: CI creating a coverage report (#209)
1 parent c39c20b commit 3325489

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

.github/workflows/coverate.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Make a coverate report
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, reopened, review_requested, synchronize]
7+
workflow_dispatch:
8+
9+
env:
10+
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar:/usr/lib/opensourcecobol4j/sqlite.jar"
11+
12+
jobs:
13+
run-tests:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Install dependencies on Ubuntu 22.04
18+
run: |
19+
sudo apt update -y
20+
sudo apt install -y default-jdk build-essential bison flex gettext texinfo automake autoconf gcovr
21+
22+
- name: Checkout opensource COBOL 4J
23+
uses: actions/checkout@v3
24+
25+
- name: Install opensource COBOL 4J
26+
run: |
27+
./configure CFLAGS='-fprofile-arcs -ftest-coverage' --prefix=/usr/
28+
make
29+
sudo make install
30+
31+
- name: Run tests "command-line-options"
32+
run: |
33+
cd tests/
34+
./command-line-options
35+
36+
- name: Run tests "misc"
37+
run: |
38+
cd tests/
39+
./misc
40+
41+
- name: Run tests "data-rep"
42+
run: |
43+
cd tests/
44+
./data-rep
45+
46+
- name: Run tests "i18n_sjis"
47+
run: |
48+
cd tests/
49+
./i18n_sjis
50+
51+
- name: Run tests "jp-compat"
52+
run: |
53+
cd tests/
54+
./jp-compat
55+
56+
- name: Run tests "run"
57+
run: |
58+
cd tests/
59+
./run
60+
61+
- name: Run tests "syntax"
62+
run: |
63+
cd tests/
64+
./syntax
65+
66+
- name: Run NIST test
67+
run: |
68+
cd tests/cobol85
69+
make test
70+
71+
- name: Run Extra NIST test
72+
run: |
73+
cd tests/cobol85
74+
make test-extra
75+
76+
#- name: Run tests "i18n_utf8"
77+
# run: |
78+
# ./configure --prefix=/usr/ --with-vbisam --enable-utf8
79+
# make
80+
# make install
81+
# ./i18n_utf8 || true
82+
# cd ../
83+
84+
- name: Make a coverage report
85+
run: |
86+
cd cobj
87+
gcov -l *.gcda
88+
gcovr -r . --html -o report.html
89+
mkdir coverage-report
90+
cp *.gcno *.gcda *.gcov report.html coverage-report
91+
92+
- name: Archive a coverage report
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: code-coverage-report
96+
path: cobj/coverage-report/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ bin/cob-config
6969
bin/cobcrun
7070
bin/cobcrun-cobcrun.o
7171
configure~
72+
*.gcov
73+
*.gcda
74+
*.gcno
75+
report.html

0 commit comments

Comments
 (0)