Add UI HTTP server (#6)
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
CommitLineData
a9c0de45 1name: CI
69d993b0
JB
2on:
3 push:
4 branches:
9c1b1b03 5 - main
c4f11906 6 pull_request:
613dc1b7 7 types: [opened, synchronize, reopened]
69d993b0
JB
8jobs:
9 build:
c1eafbfc 10 runs-on: ${{ matrix.os }}
69d993b0
JB
11 strategy:
12 matrix:
c1eafbfc 13 os: [windows-latest, macos-latest, ubuntu-latest]
1f7fa4de 14 node: ['16.x', '18.x']
69d993b0 15 steps:
0642c3d2 16 - uses: actions/checkout@v3
e7aeea18
JB
17 with:
18 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
0642c3d2
JB
19 - name: Use Node.js ${{ matrix.node }}
20 uses: actions/setup-node@v3
e7aeea18 21 with:
0642c3d2 22 node-version: ${{ matrix.node }}
e7aeea18
JB
23 - name: npm install
24 run: npm ci
25 - name: npm run lint
26 run: npm run lint
27 continue-on-error: true
28 - name: npm run build
29 run: npm run build
30 - name: npm test
31 run: npm test
32 - name: npm run coverage
df954599 33 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
e7aeea18
JB
34 run: npm run coverage
35 - name: SonarCloud Scan
7f774a55 36 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
e7aeea18
JB
37 uses: sonarsource/sonarcloud-github-action@master
38 env:
39 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
40 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32de5a57
LM
41 build-dashboard:
42 runs-on: ${{ matrix.os }}
43 defaults:
44 run:
45 working-directory: src/ui/web
46 strategy:
47 matrix:
48 os: [windows-latest, macos-latest, ubuntu-latest]
1f7fa4de 49 node: ['16.x', '18.x']
32de5a57
LM
50 steps:
51 - uses: actions/checkout@v3
52 with:
53 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
54 - name: Use Node.js ${{ matrix.node }}
55 uses: actions/setup-node@v3
56 with:
57 node-version: ${{ matrix.node }}
58 - name: npm install
59 run: npm ci
60 - name: npm run lint
61 run: npm run lint
62 continue-on-error: true
63 - name: npm run build
64 run: npm run build
65 - name: npm test
66 run: npm test
67 # - name: npm run coverage
68 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
69 # run: npm run coverage
70 # - name: SonarCloud Scan
71 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
72 # uses: sonarsource/sonarcloud-github-action@master
73 # env:
74 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
75 # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
a9c0de45 76 build-docker:
c168e7ad
JB
77 runs-on: ubuntu-latest
78 steps:
0642c3d2 79 - uses: actions/checkout@v3
e7aeea18
JB
80 - name: Set up Docker Buildx
81 id: buildx
c1eafbfc 82 uses: docker/setup-buildx-action@v2
e7aeea18
JB
83 - name: Build docker image
84 run: |
85 cd docker
86 make SUBMODULES_INIT=false