-
Notifications
You must be signed in to change notification settings - Fork 38
69 lines (57 loc) · 2.01 KB
/
coverage.yml
File metadata and controls
69 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
62
63
64
65
66
67
68
69
name: Coverage
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
env:
CLASSPATH: ":/usr/lib/opensourcecobol4j/libcobj.jar"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
- name: Install dependencies on Ubuntu
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential gettext autoconf bison flex gcovr
- name: Checkout opensource COBOL 4J
uses: actions/checkout@v6
- name: Install opensource COBOL 4J
run: |
./configure --prefix=/usr/ CFLAGS='-fprofile-arcs -ftest-coverage'
make
sudo make install
- name: Run NIST test
working-directory: tests/cobol85
run: make test || true
- name: Run other tests
working-directory: tests
run: |
tests=("command-line-options" "data-rep" "i18n_sjis" "jp-compat" "run" "syntax" "cobj-idx" "file-lock" "file-lock2" "misc")
for test in "${tests[@]}"; do
if [ "$test" = "file-lock" ] || [ "$test" = "file-lock2" ] || [ "$test" = "cobj-idx" ]; then
./"$test" || true
else
./"$test" -j || true
fi
done
- name: Generate a coverage report
working-directory: cobj
run: |
gcov -l ./*.gcda
gcovr -r . \
-e cobj-parser -e cobj-scanner -e cobj-pplex -e cobj-ppparse \
-e parser.c -e parser.y -e scanner.l -e scanner.c -e pplex.l -e pplex.c -e ppparse.y -e ppparse.c \
-e flag-help.def -e warning-help.def -e warning.def \
--html-details --html-self-contained --html -o report.html --txt-metric=branch
mkdir -p coverage-report
cp ./*.html coverage-report
- name: Archive a coverage report
uses: actions/upload-artifact@v7
with:
name: code-coverage-report
path: cobj/coverage-report/