]> source.dussan.org Git - sonarqube.git/commitdiff
[NO-JIRA] Generate and consume frontend code coverage reports
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Fri, 4 Feb 2022 16:49:07 +0000 (17:49 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 7 Feb 2022 20:02:53 +0000 (20:02 +0000)
.travis.yml
travis.sh

index f2f9dbcffa96902e80df64953c28a4f5c1c447cb..c46a4fd91ffd4b056e5396226cc2cb648a1d2c54 100644 (file)
@@ -12,11 +12,7 @@ branches:
   except:
     - /^dogfood\/.*$/
     - public_master
-
-env:
-  - TARGET=BUILD
-  - TARGET=WEB_TESTS
-
+    
 matrix:
   fast_finish: true
 
index bd101964e3f436c054e1c293239c3ada56195be0..676ee886aa62bc22b8e220c05ec8a3c4f07c6884 100755 (executable)
--- a/travis.sh
+++ b/travis.sh
@@ -32,44 +32,28 @@ keep_alive &
 # @TravisCI please provide the feature natively, like at AppVeyor or CircleCI ;-)
 cancel_branch_build_with_pr || if [[ $? -eq 1 ]]; then exit 0; fi
 
-case "$TARGET" in
-
-BUILD)
-  git fetch --unshallow
-  ./gradlew build --no-daemon --console plain
-
-  # the '-' at the end is needed when using set -u (the 'nounset' flag)
-  # see https://stackoverflow.com/a/9824943/641955
-  if [[ -n "${SONAR_TOKEN-}" ]]; then
-    if [[ "${TRAVIS_BRANCH}" == "master" ]]; then
-      ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \
-        -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \
-        -Dsonar.organization=sonarsource \
-        -Dsonar.host.url=https://sonarcloud.io \
-        -Dsonar.login="$SONAR_TOKEN"
-    else
-      ./gradlew jacocoTestReport sonarqube --info --no-daemon --console plain \
-        -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \
-        -Dsonar.organization=sonarsource \
-        -Dsonar.host.url=https://sonarcloud.io \
-        -Dsonar.login="$SONAR_TOKEN" \
-        -Dsonar.branch.name="$TRAVIS_BRANCH"
-    fi
-    
-    # Wait for 5mins, hopefully the report will be processed.
-    sleep 5m
-    ./.travis/run_iris.sh
+git fetch --unshallow
+./gradlew build --no-daemon --console plain
+
+# the '-' at the end is needed when using set -u (the 'nounset' flag)
+# see https://stackoverflow.com/a/9824943/641955
+if [[ -n "${SONAR_TOKEN-}" ]]; then
+  if [[ "${TRAVIS_BRANCH}" == "master" ]]; then 
+    ./gradlew jacocoTestReport :server:sonar-web:yarn_validate-ci sonarqube --info --no-daemon --console plain \
+      -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \
+      -Dsonar.organization=sonarsource \
+      -Dsonar.host.url=https://sonarcloud.io \
+      -Dsonar.login="$SONAR_TOKEN"
+  else
+    ./gradlew jacocoTestReport :server:sonar-web:yarn_validate-ci sonarqube --info --no-daemon --console plain \
+      -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \
+      -Dsonar.organization=sonarsource \
+      -Dsonar.host.url=https://sonarcloud.io \
+      -Dsonar.login="$SONAR_TOKEN" \
+      -Dsonar.branch.name="$TRAVIS_BRANCH"
   fi
-  ;;
-
-WEB_TESTS)
-  ./gradlew :server:sonar-web:yarn_validate-ci --no-daemon --console plain
-  ;;
   
-*)
-  echo "Unexpected TARGET value: $TARGET"
-  exit 1
-  ;;
-
-esac
-
+  # Wait for 5mins, hopefully the report will be processed.
+  sleep 5m
+  ./.travis/run_iris.sh
+fi
\ No newline at end of file