From 7ac99cfdaf2ca2c586282f9c2aa2f3b6e4247404 Mon Sep 17 00:00:00 2001 From: Karma Tsering <75218136+Karma-Tsering@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:24:28 +0530 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2796c762..c16f46dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ on: - main pull_request: types: [opened, synchronize, reopened] + jobs: sonarcloud: name: SonarCloud @@ -12,9 +13,26 @@ jobs: steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 # Shallow clones should be disabled for better analysis relevancy + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18.x' # or your project's Node.js version + + - name: Install dependencies + run: npm install + + - name: Run tests and generate coverage + run: npm run test "./app/routes/model.ocr/component/ImageCropper.test.js" -- --coverage + - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + uses: SonarSource/sonarcloud-github-action@v1.8 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + args: > + -Dsonar.organization=openpecha + -Dsonar.projectKey=OpenPecha_monlamai-app-web + -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info