Skip to content

✨ chore : improved coverage info #55

✨ chore : improved coverage info

✨ chore : improved coverage info #55

Workflow file for this run

name: SonarCloud Frontend
on:
push:
branches:
- main
paths:
- "frontend/**"
- ".github/workflows/frontendBuild.yml"
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarscan:
if: ( startsWith(github.head_ref, 'FE_') && github.event.pull_request.merged == false ) || ( github.event_name == 'push' )
name: FE Sonar Analysis
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ${{ github.workspace }}/frontend/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install the dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm install --legacy-peer-deps
- name: Test and coverage
run: npm run coverage
- name: SonarCloud Scan
with:
projectBaseDir: frontend
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}