chore: version 1.2.1
[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:
c1eafbfc 11 runs-on: ${{ matrix.os }}
69d993b0
JB
12 strategy:
13 matrix:
c1eafbfc 14 os: [windows-latest, macos-latest, ubuntu-latest]
aab42745 15 node: ['16.x', '18.x', '19.x']
69d993b0 16 steps:
0642c3d2 17 - uses: actions/checkout@v3
e7aeea18
JB
18 with:
19 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
d5d2241e 20 - name: Setup node ${{ matrix.node }}
0642c3d2 21 uses: actions/setup-node@v3
e7aeea18 22 with:
0642c3d2 23 node-version: ${{ matrix.node }}
881f450c 24 - name: pnpm install
1a662d29
JB
25 run: |
26 corepack enable
27 corepack prepare pnpm@latest --activate
28 pnpm install
881f450c
JB
29 - name: pnpm run lint
30 run: pnpm run lint
31 - name: pnpm run build
0199b616 32 run: pnpm run build
881f450c
JB
33 - name: pnpm test
34 run: pnpm test
35 - name: pnpm run coverage
c774abf5 36 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
881f450c 37 run: pnpm run coverage
e7aeea18 38 - name: SonarCloud Scan
c774abf5 39 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
e7aeea18
JB
40 uses: sonarsource/sonarcloud-github-action@master
41 env:
42 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
43 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
32de5a57
LM
44 build-dashboard:
45 runs-on: ${{ matrix.os }}
46 defaults:
47 run:
ebbfbf1c 48 working-directory: ui/web
32de5a57
LM
49 strategy:
50 matrix:
51 os: [windows-latest, macos-latest, ubuntu-latest]
aab42745 52 node: ['16.x', '18.x', '19.x']
32de5a57
LM
53 steps:
54 - uses: actions/checkout@v3
55 with:
56 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
d5d2241e 57 - name: Setup node ${{ matrix.node }}
32de5a57
LM
58 uses: actions/setup-node@v3
59 with:
60 node-version: ${{ matrix.node }}
603f1011 61 - name: pnpm install
1a662d29
JB
62 run: |
63 corepack enable
64 corepack prepare pnpm@latest --activate
65 pnpm install
603f1011
JB
66 - name: pnpm run lint
67 run: pnpm run lint
68 - name: pnpm run build
0199b616 69 run: pnpm run build
603f1011
JB
70 - name: pnpm test
71 run: pnpm test
72 # - name: pnpm run coverage
c774abf5 73 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
603f1011 74 # run: pnpm run coverage
c2d3028f 75 # - name: SonarCloud Scan
c774abf5 76 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
c2d3028f
JB
77 # uses: sonarsource/sonarcloud-github-action@master
78 # with:
79 # projectBaseDir: ui/web
80 # env:
81 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
82 # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
a9c0de45 83 build-docker:
4bfd22de 84 runs-on: ubuntu-latest
c168e7ad 85 steps:
0642c3d2 86 - uses: actions/checkout@v3
d5d2241e 87 - name: Setup Docker Buildx
e7aeea18 88 id: buildx
c1eafbfc 89 uses: docker/setup-buildx-action@v2
e7aeea18
JB
90 - name: Build docker image
91 run: |
92 cd docker
93 make SUBMODULES_INIT=false