-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (34 loc) · 1.19 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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/**