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;
29 name: Build OCPP mock server with Python ${{ matrix.python }}
30 runs-on: ubuntu-latest
33 working-directory: tests/ocpp-server
35 - uses: actions/checkout@v4
36 - name: Setup Python ${{ matrix.python }}
37 uses: actions/setup-python@v5
39 python-version: ${{ matrix.python }}
40 - name: Install Poetry
41 run: pip install poetry
42 - name: Install Dependencies
43 run: poetry install --no-root
45 run: poetry run task lint
47 needs: [check-secrets]
50 os: [windows-latest, macos-latest, ubuntu-latest]
51 node: ['20.x', 'latest']
52 name: Build simulator with Node ${{ matrix.node }} on ${{ matrix.os }}
53 runs-on: ${{ matrix.os }}
55 - uses: actions/checkout@v4
57 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
58 - name: Dependency Review
59 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
60 uses: actions/dependency-review-action@v4
62 base-ref: ${{ github.ref_name }}
63 head-ref: ${{ github.sha }}
64 - name: Pull Request Dependency Review
65 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
66 uses: actions/dependency-review-action@v4
67 - uses: pnpm/action-setup@v4
68 - name: Setup node ${{ matrix.node }}
69 uses: actions/setup-node@v4
71 node-version: ${{ matrix.node }}
74 run: pnpm install --ignore-scripts --frozen-lockfile
76 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
77 run: pnpm audit --prod
79 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
86 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
88 - name: SonarCloud Scan
89 if: ${{ needs.check-secrets.outputs.sonar-token-exists == 'true' && github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
90 uses: sonarsource/sonarcloud-github-action@v2.3.0
92 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
95 needs: [check-secrets]
98 os: [windows-latest, macos-latest, ubuntu-latest]
99 node: ['18.x', '20.x', 'latest']
100 name: Build dashboard with Node ${{ matrix.node }} on ${{ matrix.os }}
101 runs-on: ${{ matrix.os }}
104 working-directory: ui/web
106 - uses: actions/checkout@v4
108 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
109 - name: Dependency Review
110 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
111 uses: actions/dependency-review-action@v4
113 base-ref: ${{ github.ref_name }}
114 head-ref: ${{ github.sha }}
115 - name: Pull Request Dependency Review
116 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
117 uses: actions/dependency-review-action@v4
118 - uses: pnpm/action-setup@v4
119 - name: Setup node ${{ matrix.node }}
120 uses: actions/setup-node@v4
122 node-version: ${{ matrix.node }}
125 run: pnpm install --ignore-scripts --frozen-lockfile
127 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
128 run: pnpm audit --prod
130 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
136 - name: pnpm coverage
137 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
139 - name: SonarCloud Scan
140 if: ${{ needs.check-secrets.outputs.sonar-token-exists == 'true' && github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
141 uses: sonarsource/sonarcloud-github-action@v2.3.0
143 projectBaseDir: ui/web
145 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
148 runs-on: ubuntu-latest
149 name: Build docker image
151 - uses: actions/checkout@v4
152 - name: Setup Docker Buildx
154 uses: docker/setup-buildx-action@v3
155 - name: Build docker image
158 make SUBMODULES_INIT=false