Add sonarcloud to GitHub actions
[e-mobility-charging-stations-simulator.git] / .github / workflows / build.yml
1 name: Build CI
2 on:
3 push:
4 branches:
5 - master
6 pull_request:
7 types: [opened, synchronize, reopened]
8 branches:
9 - master
10 jobs:
11 build:
12 runs-on: ubuntu-latest
13 strategy:
14 matrix:
15 node-version: [14.x]
16 steps:
17 - uses: actions/checkout@v2
18 - name: Use Node.js ${{ matrix.node-version }}
19 uses: actions/setup-node@v2
20 with:
21 node-version: ${{ matrix.node-version }}
22 - name: npm install
23 run: npm ci
24 - name: npm run build
25 run: npm run build
26 docker:
27 runs-on: ubuntu-latest
28 steps:
29 - uses: actions/checkout@v2
30 - name: Set up Docker Buildx
31 id: buildx
32 uses: docker/setup-buildx-action@v1
33 - name: Build docker image
34 run: |
35 cd docker
36 make SUBMODULES_INIT=false
37 sonarcloud:
38 name: SonarCloud
39 runs-on: ubuntu-latest
40 steps:
41 - uses: actions/checkout@v2
42 with:
43 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
44 - name: SonarCloud Scan
45 uses: SonarSource/sonarcloud-github-action@master
46 env:
47 GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} # Needed to get PR information, if any
48 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
49