Apply prettier formating
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
CommitLineData
a9c0de45 1name: CI
69d993b0
JB
2on:
3 push:
4 branches:
5 - master
c4f11906 6 pull_request:
613dc1b7 7 types: [opened, synchronize, reopened]
69d993b0
JB
8jobs:
9 build:
10 runs-on: ubuntu-latest
11 strategy:
12 matrix:
c2c35ebf 13 node-version: ['14.x', '16.x', '17.x']
69d993b0 14 steps:
e7aeea18
JB
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 }}
a9c0de45 39 build-docker:
c168e7ad
JB
40 runs-on: ubuntu-latest
41 steps:
e7aeea18
JB
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