Browse Source

Try to run sonarqube/sonarcloud in travis...

Godzil 6 years ago
parent
commit
8f51c4712c
2 changed files with 22 additions and 0 deletions
  1. 16 0
      .travis.yml
  2. 6 0
      sonar-project.properties

+ 16 - 0
.travis.yml

@@ -1,3 +1,4 @@
+dist: trusty
 language: c
 os:
   - linux
@@ -13,6 +14,10 @@ addons:
       - curl
       - xorg-dev
       - libglu1-mesa-dev
+  sonarcloud:
+    organisation: "godzil-github"
+    token:
+      secure: ${SONARCLOUD_TOKEN}
 
 compiler:
   - clang
@@ -24,12 +29,23 @@ script:
   - cmake -DUSE_ALLEGRO=OFF -DUSE_PROFILING=OFF -DCOVERALLS=OFF -DCMAKE_BUILD_TYPE=Release ..
   - cmake --build .
   - cd ..
+  - mkdir sonar
+  - cd sonar
+  - cmake -DUSE_ALLEGRO=OFF -DUSE_PROFILING=OFF -DCOVERALLS=OFF -DCMAKE_BUILD_TYPE=Release ..
+  - make clean
+  - build-wrapper-linux-x86-64 --out-dir bw-output cmake --build .
+  - cd ..
+  - sonar-scanner
   - mkdir coverage
   - cd coverage
   - cmake -DUSE_ALLEGRO=OFF -DUSE_PROFILING=OFF -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug ..
   - cmake --build .
   - cmake --build . --target coveralls
 
+cache:
+  directories:
+    - '$HOME/.sonar/cache'
+
 before_install:
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update      ; fi
   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install glew; fi

+ 6 - 0
sonar-project.properties

@@ -0,0 +1,6 @@
+sonar.projectKey=peTI-NESulator
+sonar.projectName=peTI-NESulator
+sonar.projectVersion=git-edition
+sonar.sources=src
+
+sonar.cfamily.build-wrapper-output=sonar/bw-output