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