From 038f796d7aaa77f89d81322b5170c4134840b631 Mon Sep 17 00:00:00 2001 From: Guido Pochettino Date: Wed, 14 Dec 2022 13:18:44 -0300 Subject: [PATCH 1/2] AUT-1705: Add Sonar to SDK react-native-client. --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 879d751..9c1f55e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up nodejs uses: actions/setup-node@v2 @@ -29,7 +31,48 @@ jobs: run: npm run check - name: npm Test - run: npm run test + run: npm run test -- --coverage - name: npm Build run: npm run build + + - name: SonarQube Scan (Push) + if: github.event_name == 'push' + uses: SonarSource/sonarcloud-github-action@v1.6 + env: + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} + with: + projectBaseDir: . + args: > + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} + -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey=${{ github.event.repository.name }} + -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info + -Dsonar.exclusions=**/*.java + -Dsonar.c.file.suffixes=- + -Dsonar.cpp.file.suffixes=- + -Dsonar.objc.file.suffixes=- + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" + + - name: SonarQube Scan (Pull Request) + if: github.event_name == 'pull_request' + uses: SonarSource/sonarcloud-github-action@v1.6 + env: + SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} + with: + projectBaseDir: . + args: > + -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} + -Dsonar.projectName=${{ github.event.repository.name }} + -Dsonar.projectKey=${{ github.event.repository.name }} + -Dsonar.links.ci="https://github.com/splitio/${{ github.event.repository.name }}/actions" + -Dsonar.links.scm="https://github.com/splitio/${{ github.event.repository.name }}" + -Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info + -Dsonar.exclusions=**/*.java + -Dsonar.c.file.suffixes=- + -Dsonar.cpp.file.suffixes=- + -Dsonar.objc.file.suffixes=- + -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} + -Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} + -Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} From 94e8d2067d27e10794a387ac6e169e87ca6c9f0f Mon Sep 17 00:00:00 2001 From: Guido Pochettino Date: Thu, 15 Dec 2022 09:55:39 -0300 Subject: [PATCH 2/2] AUT-1705: Updating versions from review comments. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c1f55e..168c3d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Set up nodejs - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '16.16.0' cache: 'npm' @@ -38,7 +38,7 @@ jobs: - name: SonarQube Scan (Push) if: github.event_name == 'push' - uses: SonarSource/sonarcloud-github-action@v1.6 + uses: SonarSource/sonarcloud-github-action@v1.8 env: SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} with: @@ -57,7 +57,7 @@ jobs: - name: SonarQube Scan (Pull Request) if: github.event_name == 'pull_request' - uses: SonarSource/sonarcloud-github-action@v1.6 + uses: SonarSource/sonarcloud-github-action@v1.8 env: SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} with: