6 types: [opened, synchronize, reopened]
11 runs-on: ubuntu-latest
13 sonar-token-exists: ${{ steps.sonar-token.outputs.defined }}
15 - name: Check for SonarCloud Token Availability
19 if [ "${{ secrets.SONAR_TOKEN }}" != '' ]; then
20 echo "defined=true" >> $GITHUB_OUTPUT;
22 echo "defined=false" >> $GITHUB_OUTPUT;
25 needs: [check-secrets]
28 os: [windows-latest, macos-latest, ubuntu-latest]
29 node: ['18.x', '20.x']
30 name: Build simulator with Node ${{ matrix.node }} on ${{ matrix.os }}
31 runs-on: ${{ matrix.os }}
33 - uses: actions/checkout@v4
35 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
36 - name: Dependency Review
37 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
38 uses: actions/dependency-review-action@v3
40 base-ref: ${{ github.ref_name }}
41 head-ref: ${{ github.sha }}
42 - name: Pull Request Dependency Review
43 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
44 uses: actions/dependency-review-action@v3
45 - uses: pnpm/action-setup@v2
48 - name: Setup node ${{ matrix.node }}
49 uses: actions/setup-node@v3
51 node-version: ${{ matrix.node }}
54 run: pnpm install --ignore-scripts
56 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
63 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
65 - name: SonarCloud Scan
66 if: ${{ needs.check-secrets.outputs.sonar-token-exists == 'true' && github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
67 uses: sonarsource/sonarcloud-github-action@v2.0.2
69 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
72 needs: [check-secrets]
75 os: [windows-latest, macos-latest, ubuntu-latest]
76 node: ['16.x', '18.x', '20.x']
77 name: Build dashboard with Node ${{ matrix.node }} on ${{ matrix.os }}
78 runs-on: ${{ matrix.os }}
81 working-directory: ui/web
83 - uses: actions/checkout@v4
85 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
86 - name: Dependency Review
87 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
88 uses: actions/dependency-review-action@v3
90 base-ref: ${{ github.ref_name }}
91 head-ref: ${{ github.sha }}
92 - name: Pull Request Dependency Review
93 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
94 uses: actions/dependency-review-action@v3
95 - uses: pnpm/action-setup@v2
98 - name: Setup node ${{ matrix.node }}
99 uses: actions/setup-node@v3
101 node-version: ${{ matrix.node }}
104 run: pnpm install --ignore-scripts
106 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
112 - name: pnpm coverage
113 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
115 - name: SonarCloud Scan
116 if: ${{ needs.check-secrets.outputs.sonar-token-exists == 'true' && github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '18.x' }}
117 uses: sonarsource/sonarcloud-github-action@v2.0.2
119 projectBaseDir: ui/web
121 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
124 runs-on: ubuntu-latest
125 name: Build docker image
127 - uses: actions/checkout@v4
128 - name: Setup Docker Buildx
130 uses: docker/setup-buildx-action@v3
131 - name: Build docker image
134 make SUBMODULES_INIT=false