Add coverage run to GitHub actions
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
1 name: 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 with:
19 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20 - name: Use Node.js ${{ matrix.node-version }}
21 uses: actions/setup-node@v2
22 with:
23 node-version: ${{ matrix.node-version }}
24 - name: npm install
25 run: npm ci
26 - name: npm run build
27 run: npm run build
28 - name: npm run lint
29 run: npm run lint
30 - name: npm test
31 run: npm test
32 - name: npm run coverage
33 run: npm run coverage
34 - name: SonarCloud Scan
35 uses: SonarSource/sonarcloud-github-action@master
36 env:
37 GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} # Needed to get PR information, if any
38 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39 build-docker:
40 runs-on: ubuntu-latest
41 steps:
42 - uses: actions/checkout@v2
43 - name: Set up Docker Buildx
44 id: buildx
45 uses: docker/setup-buildx-action@v1
46 - name: Build docker image
47 run: |
48 cd docker
49 make SUBMODULES_INIT=false