Skip to content

NSC number validation #127

NSC number validation

NSC number validation #127

name: sonar-scan-frontend
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]
branches-ignore:
- master
- main
paths:
- roadside-forms-frontend/frontend_web_app/**
- .github/workflows/roadside_forms_frontend-ci.yml
- trigger.txt
push:
branches:
- feature/backendsonar
# on:
# workflow_dispatch:
# pull_request:
# types: [opened, synchronize, reopened]
# branches-ignore:
# - master
# - main
# push:
# branches:
# - feature/backendsonar
permissions:
contents: read
jobs:
sonarcloud-frontend:
name: SonarCloud-frontend
runs-on: ubuntu-latest
# permissions: write-all
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install dependencies
run: |
cd roadside-forms-frontend/frontend_web_app
npm ci
- name: Build the app
env:
CI: ""
REACT_APP_KEYCLOAK_URL: ${{ secrets.REACT_APP_KEYCLOAK_URL }}
REACT_APP_KEYCLOAK_REALM: ${{ secrets.REACT_APP_KEYCLOAK_REALM }}
REACT_APP_KEYCLOAK_CLIENT_ID: ${{ secrets.REACT_APP_KEYCLOAK_CLIENT_ID }}
REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL_DEV }}
run: |
cd roadside-forms-frontend/frontend_web_app
npm run build:ci
- name: Run Tests
run: |
cd roadside-forms-frontend/frontend_web_app
npm run coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: roadside-forms-frontend/frontend_web_app