diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2796c76..c16f46d 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