3feffe8b61c19294e47362a0bd4180803e58a4e9
[e-mobility-charging-stations-simulator.git] / .github / workflows / ci.yml
1 name: CI
2 on:
3 push:
4 branches:
5 - main
6 pull_request:
7 types: [opened, synchronize, reopened]
8 jobs:
9 build:
10 runs-on: ${{ matrix.os }}
11 strategy:
12 matrix:
13 os: [windows-latest, macos-latest, ubuntu-latest]
14 node: ['14.x', '16.x', '18.x']
15 steps:
16 - uses: actions/checkout@v3
17 with:
18 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
19 - name: Use Node.js ${{ matrix.node }}
20 uses: actions/setup-node@v3
21 with:
22 node-version: ${{ matrix.node }}
23 - name: npm install
24 run: npm ci
25 - name: npm run lint
26 run: npm run lint
27 continue-on-error: true
28 - name: npm run build
29 run: npm run build
30 - name: npm test
31 run: npm test
32 - name: npm run coverage
33 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
34 run: npm run coverage
35 - name: SonarCloud Scan
36 if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
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 }}
41 build-dashboard:
42 runs-on: ${{ matrix.os }}
43 defaults:
44 run:
45 working-directory: src/ui/web
46 strategy:
47 matrix:
48 os: [windows-latest, macos-latest, ubuntu-latest]
49 node: ['14.x', '16.x', '18.x']
50 steps:
51 - uses: actions/checkout@v3
52 with:
53 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
54 - name: Use Node.js ${{ matrix.node }}
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
62 continue-on-error: true
63 - name: npm run build
64 run: npm run build
65 - name: npm test
66 run: npm test
67 # - name: npm run coverage
68 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
69 # run: npm run coverage
70 # - name: SonarCloud Scan
71 # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'"
72 # uses: sonarsource/sonarcloud-github-action@master
73 # env:
74 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
75 # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
76 build-docker:
77 runs-on: ubuntu-latest
78 steps:
79 - uses: actions/checkout@v3
80 - name: Set up Docker Buildx
81 id: buildx
82 uses: docker/setup-buildx-action@v2
83 - name: Build docker image
84 run: |
85 cd docker
86 make SUBMODULES_INIT=false