Skip to content

Update build.yml

Update build.yml #37

Workflow file for this run

name: Build
on:
push:
branches:
- main
- staging
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
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 test "./app/component/__test__/ActionButtons.test.js" -- --coverage
- name: SonarCloud Scan
uses: SonarSource/[email protected]
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