FCRM-5430 applied standards #1698
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Run CI Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install nodejs | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "16.14.x" | |
- name: Install node dependencies | |
run: npm i | |
- name: Run unit tests | |
run: | | |
cp ./config/.env-example .env | |
npm run test | |
sed -i 's/\/home\/runner\/work\/fmp-app\/fmp-app\//\/github\/workspace\//g' lcov.info | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=defra | |
-Dsonar.projectKey=DEFRA_fmp-app | |
-Dsonar.exclusions=**/node_modules/**,**/test/**,**/test-output/** | |
-Dsonar.javascript.lcov.reportPaths=lcov.info | |
-Dsonar.javascript.exclusions=**/node_modules/**,**/test/**,**/test-output/**,**/server/dist/**,**/server/src/** |