build: switch to latest pnpm version with related formats
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
1 name: CI
2 on:
3 push:
4 branches: [main]
5 pull_request:
6 types: [opened, synchronize, reopened]
7 merge_group:
8 branches: [main]
9 jobs:
10 build:
11 runs-on: ${{ matrix.os }}
12 strategy:
13 matrix:
14 os: [windows-latest, macos-latest, ubuntu-latest]
15 node: ['16.x', '18.x', '19.x']
16 steps:
17 - uses: actions/checkout@v3
18 with:
19 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
20 - name: Setup node ${{ matrix.node }}
21 uses: actions/setup-node@v3
22 with:
23 node-version: ${{ matrix.node }}
24 - name: pnpm install
25 run: |
26 corepack enable
27 corepack prepare pnpm@latest --activate
28 pnpm install
29 - name: pnpm run lint
30 run: pnpm run lint
31 - name: pnpm run build
32 run: pnpm run build
33 - name: pnpm test
34 run: pnpm test
35 - name: pnpm run coverage
36 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
37 run: pnpm run coverage
38 - name: SonarCloud Scan
39 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
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 }}
44 build-dashboard:
45 runs-on: ${{ matrix.os }}
46 defaults:
47 run:
48 working-directory: ui/web
49 strategy:
50 matrix:
51 os: [windows-latest, macos-latest, ubuntu-latest]
52 node: ['16.x', '18.x', '19.x']
53 steps:
54 - uses: actions/checkout@v3
55 with:
56 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
57 - name: Setup node ${{ matrix.node }}
58 uses: actions/setup-node@v3
59 with:
60 node-version: ${{ matrix.node }}
61 - name: corepack enable
62 run: corepack enable
63 - name: pnpm install
64 run: |
65 corepack enable
66 corepack prepare pnpm@latest --activate
67 pnpm install
68 - name: pnpm run lint
69 run: pnpm run lint
70 - name: pnpm run build
71 run: pnpm run build
72 - name: pnpm test
73 run: pnpm test
74 # - name: pnpm run coverage
75 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
76 # run: pnpm run coverage
77 # - name: SonarCloud Scan
78 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x'"
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 }}
85 build-docker:
86 runs-on: ubuntu-latest
87 steps:
88 - uses: actions/checkout@v3
89 - name: Setup Docker Buildx
90 id: buildx
91 uses: docker/setup-buildx-action@v2
92 - name: Build docker image
93 run: |
94 cd docker
95 make SUBMODULES_INIT=false