Commit | Line | Data |
---|---|---|
a9c0de45 | 1 | name: CI |
69d993b0 JB |
2 | on: |
3 | push: | |
4 | branches: | |
9c1b1b03 | 5 | - main |
c4f11906 | 6 | pull_request: |
613dc1b7 | 7 | types: [opened, synchronize, reopened] |
69d993b0 JB |
8 | jobs: |
9 | build: | |
c1eafbfc | 10 | runs-on: ${{ matrix.os }} |
69d993b0 JB |
11 | strategy: |
12 | matrix: | |
c1eafbfc | 13 | os: [windows-latest, macos-latest, ubuntu-latest] |
1f7fa4de | 14 | node: ['16.x', '18.x'] |
69d993b0 | 15 | steps: |
0642c3d2 | 16 | - uses: actions/checkout@v3 |
e7aeea18 JB |
17 | with: |
18 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
0642c3d2 JB |
19 | - name: Use Node.js ${{ matrix.node }} |
20 | uses: actions/setup-node@v3 | |
e7aeea18 | 21 | with: |
0642c3d2 | 22 | node-version: ${{ matrix.node }} |
e7aeea18 JB |
23 | - name: npm install |
24 | run: npm ci | |
25 | - name: npm run lint | |
26 | run: npm run lint | |
e7aeea18 | 27 | - name: npm run build |
46df94cf | 28 | run: npm run build --if-present |
e7aeea18 JB |
29 | - name: npm test |
30 | run: npm test | |
31 | - name: npm run coverage | |
df954599 | 32 | if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'" |
e7aeea18 JB |
33 | run: npm run coverage |
34 | - name: SonarCloud Scan | |
7f774a55 | 35 | if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'" |
e7aeea18 JB |
36 | uses: sonarsource/sonarcloud-github-action@master |
37 | env: | |
38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
39 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
32de5a57 LM |
40 | build-dashboard: |
41 | runs-on: ${{ matrix.os }} | |
42 | defaults: | |
43 | run: | |
44 | working-directory: src/ui/web | |
45 | strategy: | |
46 | matrix: | |
47 | os: [windows-latest, macos-latest, ubuntu-latest] | |
1f7fa4de | 48 | node: ['16.x', '18.x'] |
32de5a57 LM |
49 | steps: |
50 | - uses: actions/checkout@v3 | |
51 | with: | |
52 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
53 | - name: Use Node.js ${{ matrix.node }} | |
54 | uses: actions/setup-node@v3 | |
55 | with: | |
56 | node-version: ${{ matrix.node }} | |
57 | - name: npm install | |
58 | run: npm ci | |
59 | - name: npm run lint | |
60 | run: npm run lint | |
32de5a57 | 61 | - name: npm run build |
46df94cf | 62 | run: npm run build --if-present |
32de5a57 LM |
63 | - name: npm test |
64 | run: npm test | |
65 | # - name: npm run coverage | |
66 | # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'" | |
67 | # run: npm run coverage | |
68 | # - name: SonarCloud Scan | |
69 | # if: "github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '16.x'" | |
70 | # uses: sonarsource/sonarcloud-github-action@master | |
71 | # env: | |
72 | # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
73 | # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
a9c0de45 | 74 | build-docker: |
4bfd22de | 75 | runs-on: ubuntu-latest |
c168e7ad | 76 | steps: |
0642c3d2 | 77 | - uses: actions/checkout@v3 |
e7aeea18 JB |
78 | - name: Set up Docker Buildx |
79 | id: buildx | |
c1eafbfc | 80 | uses: docker/setup-buildx-action@v2 |
e7aeea18 JB |
81 | - name: Build docker image |
82 | run: | | |
83 | cd docker | |
84 | make SUBMODULES_INIT=false |