build(ci): add build type to workflow jobs name
[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]
b58224be
JB
7 merge_group:
8 branches: [main]
69d993b0
JB
9jobs:
10 build:
69d993b0
JB
11 strategy:
12 matrix:
c1eafbfc 13 os: [windows-latest, macos-latest, ubuntu-latest]
4fc9b19e 14 node: ['16.x', '18.x', '20.x']
ebb77a4c 15 name: Build simulator with Node ${{ matrix.node }} on ${{ matrix.os }}
916678e9 16 runs-on: ${{ matrix.os }}
69d993b0 17 steps:
49722c24 18 - uses: actions/checkout@v4
e7aeea18
JB
19 with:
20 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
e3874421
JB
21 - uses: pnpm/action-setup@v2
22 with:
23 version: 8
d5d2241e 24 - name: Setup node ${{ matrix.node }}
0642c3d2 25 uses: actions/setup-node@v3
e7aeea18 26 with:
0642c3d2 27 node-version: ${{ matrix.node }}
e3874421 28 cache: 'pnpm'
881f450c 29 - name: pnpm install
916678e9 30 run: pnpm install --ignore-scripts
e3874421 31 - name: pnpm lint
906ba5c5 32 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
e3874421
JB
33 run: pnpm lint
34 - name: pnpm build
35 run: pnpm build
881f450c
JB
36 - name: pnpm test
37 run: pnpm test
e3874421 38 - name: pnpm coverage
ef28112f 39 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
e3874421 40 run: pnpm coverage
e7aeea18 41 - name: SonarCloud Scan
ef28112f 42 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
8ea00e38 43 uses: sonarsource/sonarcloud-github-action@v2.0.0
e7aeea18 44 env:
18b41d7e 45 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e7aeea18 46 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32de5a57 47 build-dashboard:
32de5a57
LM
48 strategy:
49 matrix:
50 os: [windows-latest, macos-latest, ubuntu-latest]
4fc9b19e 51 node: ['16.x', '18.x', '20.x']
ebb77a4c 52 name: Build dashboard with Node ${{ matrix.node }} on ${{ matrix.os }}
916678e9
JB
53 runs-on: ${{ matrix.os }}
54 defaults:
55 run:
56 working-directory: ui/web
32de5a57 57 steps:
49722c24 58 - uses: actions/checkout@v4
32de5a57
LM
59 with:
60 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
e3874421
JB
61 - uses: pnpm/action-setup@v2
62 with:
63 version: 8
d5d2241e 64 - name: Setup node ${{ matrix.node }}
32de5a57
LM
65 uses: actions/setup-node@v3
66 with:
67 node-version: ${{ matrix.node }}
e3874421 68 cache: 'pnpm'
603f1011 69 - name: pnpm install
916678e9 70 run: pnpm install --ignore-scripts
e3874421 71 - name: pnpm lint
906ba5c5 72 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
e3874421
JB
73 run: pnpm lint
74 - name: pnpm build
75 run: pnpm build
603f1011
JB
76 - name: pnpm test
77 run: pnpm test
2de63014 78 - name: pnpm coverage
ef28112f 79 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
2de63014
JB
80 run: pnpm coverage
81 - name: SonarCloud Scan
ef28112f 82 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
8ea00e38 83 uses: sonarsource/sonarcloud-github-action@v2.0.0
2de63014
JB
84 with:
85 projectBaseDir: ui/web
86 env:
18b41d7e 87 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2de63014 88 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
a9c0de45 89 build-docker:
4bfd22de 90 runs-on: ubuntu-latest
c168e7ad 91 steps:
49722c24 92 - uses: actions/checkout@v4
d5d2241e 93 - name: Setup Docker Buildx
e7aeea18 94 id: buildx
c1eafbfc 95 uses: docker/setup-buildx-action@v2
e7aeea18
JB
96 - name: Build docker image
97 run: |
98 cd docker
99 make SUBMODULES_INIT=false