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