]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Introduce an alternative code coverage testing (#1192)
authoryoupong <43817652+youpong@users.noreply.github.com>
Mon, 31 Oct 2022 13:27:06 +0000 (22:27 +0900)
committerGitHub <noreply@github.com>
Mon, 31 Oct 2022 13:27:06 +0000 (14:27 +0100)
* add a workflow for code coverage test.
* add gcov task

.github/workflows/code-coverage.yml [new file with mode: 0644]

diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
new file mode 100644 (file)
index 0000000..bb2fdea
--- /dev/null
@@ -0,0 +1,55 @@
+name: "Code Coverage"
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v3
+
+    - name: Install dependencies
+      run: |
+        sudo apt-get update
+        sudo apt-get install -y autopoint build-essential libdbi-dev libtool-bin tcl-dev lua5.1 liblua5.1-0-dev \
+                                valgrind dc python3-pip python3-setuptools libpango1.0-dev ghostscript gettext
+        sudo pip install cpp-coveralls
+    
+    - name: Build
+      run: |
+        V=$(cat VERSION)
+        ./bootstrap
+        ./configure --prefix=/opt/rrdtool-master \
+                    CFLAGS='-fprofile-arcs -ftest-coverage -O0' \
+                    LIBS=-lgcov
+        make
+        sudo make install
+        /opt/rrdtool-master/bin/rrdtool
+        /opt/rrdtool-master/share/rrdtool/examples/4charts.pl
+    - name: Run Checks
+      run: |
+        make check
+    - name: Test bindings
+      run: |
+        (cd bindings/perl-shared && make test)
+        (cd bindings/python && sudo chown -R $USER . && python setup.py test)
+    - name: Run "rrdcached-tcp"
+      run: |  
+        make check TESTS_STYLE="rrdcached-tcp"
+    - name: Run "rrdcached-udp"
+      run: |
+        make check TESTS_STYLE="rrdcached-unix"
+    - name: Run valgrind
+      run: |
+        make check TESTS_STYLE="valgrind-logfile" TESTS="modify1 modify2 modify3 modify4 modify5 tune1 tune2 graph1 rrdcreate dump-restore create-with-source-1 create-with-source-2 create-with-source-3 create-with-source-4 create-with-source-and-mapping-1 create-from-template-1 dcounter1 vformatter1 list1 pdp-calc1"
+        podchecker doc/*.pod
+    - name: gcov
+      run: |
+        (cd src && gcov *.gcno)
+        (cd src && gcov .libs/*.gcno)
+    - name: Upload coverage to Codecov
+      uses: codecov/codecov-action@v3