build: switch to latest pnpm version with related formats
[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
JB
61 - name: corepack enable
62 run: corepack enable
63 - name: pnpm install
1a662d29
JB
64 run: |
65 corepack enable
66 corepack prepare pnpm@latest --activate
67 pnpm install
603f1011
JB
68 - name: pnpm run lint
69 run: pnpm run lint
70 - name: pnpm run build
0199b616 71 run: pnpm run build
603f1011
JB
72 - name: pnpm test
73 run: pnpm test
74 # - name: pnpm run coverage
c774abf5 75 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
603f1011 76 # run: pnpm run coverage
c2d3028f 77 # - name: SonarCloud Scan
c774abf5 78 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
c2d3028f
JB
79 # uses: sonarsource/sonarcloud-github-action@master
80 # with:
81 # projectBaseDir: ui/web
82 # env:
83 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
84 # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
a9c0de45 85 build-docker:
4bfd22de 86 runs-on: ubuntu-latest
c168e7ad 87 steps:
0642c3d2 88 - uses: actions/checkout@v3
d5d2241e 89 - name: Setup Docker Buildx
e7aeea18 90 id: buildx
c1eafbfc 91 uses: docker/setup-buildx-action@v2
e7aeea18
JB
92 - name: Build docker image
93 run: |
94 cd docker
95 make SUBMODULES_INIT=false