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