Fixlet to a log message
[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:
259ee56d 13 node-version: [14.x, 16.x]
69d993b0
JB
14 steps:
15 - uses: actions/checkout@v2
a9c0de45
JB
16 with:
17 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
69d993b0 18 - name: Use Node.js ${{ matrix.node-version }}
e972b3f0 19 uses: actions/setup-node@v2
69d993b0
JB
20 with:
21 node-version: ${{ matrix.node-version }}
22 - name: npm install
23 run: npm ci
a9c0de45
JB
24 - name: npm run lint
25 run: npm run lint
a45e3d87 26 continue-on-error: true
0f90f59a
JB
27 - name: npm run build
28 run: npm run build
a9c0de45
JB
29 - name: npm test
30 run: npm test
39e1335b
JB
31 - name: npm run coverage
32 run: npm run coverage
a9c0de45 33 - name: SonarCloud Scan
bf62797f 34 if: "github.repository == 'jerome-benoit/charging-stations-simulator' && matrix.node-version == '14.x'"
c92e05e3 35 uses: sonarsource/sonarcloud-github-action@master
a9c0de45 36 env:
fb9809a7 37 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
a9c0de45
JB
38 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
39 build-docker:
c168e7ad
JB
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
c871184e
JB
46 - name: Build docker image
47 run: |
48 cd docker
e7fc6a81 49 make SUBMODULES_INIT=false