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