Skip to content

Fix Sonar issues

Fix Sonar issues #85

Workflow file for this run

on:
# Trigger npm build and Sonar analysis when pushing in main or pull requests, and when creating
# a pull request.
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
name: Build home-frontend
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Echo (debug) action details
uses: hmarr/debug-action@v2
- name: Checkout
uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Run npm install and npm run build
run: |
npm i
npm run ci:build
- name: Run SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}