Add node version 17 to CI
[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 jobs:
9 build:
10 runs-on: ubuntu-latest
11 strategy:
12 matrix:
13 node-version: ['14.x', '16.x', '17.x']
14 steps:
15 - uses: actions/checkout@v2
16 with:
17 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
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 lint
25 run: npm run lint
26 continue-on-error: true
27 - name: npm run build
28 run: npm run build
29 - name: npm test
30 run: npm test
31 - name: npm run coverage
32 run: npm run coverage
33 - name: SonarCloud Scan
34 if: "github.repository == 'jerome-benoit/charging-stations-simulator' && matrix.node-version == '16.x'"
35 uses: sonarsource/sonarcloud-github-action@master
36 env:
37 GITHUB_TOKEN: ${{ secrets.GITHUB_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