]> danny-edel.de - dspdfviewer.git/commitdiff
CI: Add a new job with the clang compiler
authorDanny Edel <mail@danny-edel.de>
Thu, 20 Oct 2022 13:28:30 +0000 (15:28 +0200)
committerDanny Edel <mail@danny-edel.de>
Thu, 20 Oct 2022 14:02:56 +0000 (16:02 +0200)
Errors in generated files have been downgraded to warnings.

.github/workflows/clang.yml [new file with mode: 0644]
cmake/compiler_clang.cmake

diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml
new file mode 100644 (file)
index 0000000..de618d3
--- /dev/null
@@ -0,0 +1,46 @@
+name: clang
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+          buildtype: [ Debug, Release ]
+    env:
+      CC: clang
+      CXX: clang++
+    steps:
+      - uses: actions/checkout@v2
+      - run: sudo apt-get update
+      - name: Install build deps
+        run: >
+            sudo apt-get install -y
+            libboost-program-options-dev
+            libboost-test-dev
+            libpoppler-qt5-dev
+            qtbase5-dev
+            qttools5-dev
+            qttools5-dev-tools
+            clang
+      - name: cmake -B build/
+        run: >
+          cmake -B build/
+          -DCMAKE_VERBOSE_MAKEFILE=ON
+          -DUsePrerenderedPDF=ON
+          -DCodeCoverage=ON
+          -DCMAKE_BUILD_TYPE=${{matrix.buildtype}}
+          .
+      - run: cmake --build build/
+      - name: run tests within xvfb
+        working-directory: build/
+        run: >
+            xvfb-run -a -s '-screen 0 1920x1080x24 -screen 1 1920x1200x24'
+            ctest --output-on-failure --timeout 60
+      - name: upload coverage
+        run: bash <(curl -s https://codecov.io/bash)
index 643536e864935efb90c2167fde4e9bc468a26011..5221676bece151b16bb56b016204768f1b3fa623 100644 (file)
@@ -29,18 +29,21 @@ endif()
 # about undefined behaviours.
 
 # So don't set Werror for it.
-# TODO: Set this only for the automoc files
+# FIXME: Set this only for the automoc files
 add_definitions(-Wno-error=undefined-reinterpret-cast)
+add_definitions(-Wno-error=redundant-parens)
+add_definitions(-Wno-error=extra-semi-stmt)
 
 # Clang on recent XCode fails to compile the boost tests
 add_definitions(-Wno-error=disabled-macro-expansion)
 
-#message(FATAL_ERROR "Version: ${CMAKE_CXX_COMPILER_VERSION}")
-
 # clang will complain about -isystem passed but not used.
 # This adds unnecessary noise
 add_definitions(-Wno-unused-command-line-argument)
 
+# unit_test_log from boost::test will trigger this warning
+add_definitions(-Wno-error=used-but-marked-unused)
+
 # qrc system generates code that triggers a lot of the
 # clang warnings.
 set_source_files_properties( ${EMBEDDED_QRC}