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: Install Poetry
37 run: pipx install poetry
38 - name: Setup Python ${{ matrix.python }}
39 uses: actions/setup-python@v5
41 python-version: ${{ matrix.python }}
43 - name: Install Dependencies
44 run: poetry install --no-root
46 run: poetry run task lint
48 needs: [check-secrets]
51 os: [windows-latest, macos-latest, ubuntu-latest]
52 node: ['20.x', 'latest']
53 name: Build simulator with Node ${{ matrix.node }} on ${{ matrix.os }}
54 runs-on: ${{ matrix.os }}
56 - uses: actions/checkout@v4
58 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
59 - name: Dependency Review
60 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
61 uses: actions/dependency-review-action@v4
63 base-ref: ${{ github.ref_name }}
64 head-ref: ${{ github.sha }}
65 - name: Pull Request Dependency Review
66 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
67 uses: actions/dependency-review-action@v4
68 - uses: pnpm/action-setup@v4
69 - name: Setup node ${{ matrix.node }}
70 uses: actions/setup-node@v4
72 node-version: ${{ matrix.node }}
75 run: pnpm install --ignore-scripts --frozen-lockfile
77 # if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
78 # run: pnpm audit --prod
80 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
87 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
89 - name: SonarCloud Scan
90 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' }}
91 uses: sonarsource/sonarcloud-github-action@v3.0.0
93 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
96 needs: [check-secrets]
99 os: [windows-latest, macos-latest, ubuntu-latest]
100 node: ['18.x', '20.x', 'latest']
101 name: Build dashboard with Node ${{ matrix.node }} on ${{ matrix.os }}
102 runs-on: ${{ matrix.os }}
105 working-directory: ui/web
107 - uses: actions/checkout@v4
109 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
110 - name: Dependency Review
111 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
112 uses: actions/dependency-review-action@v4
114 base-ref: ${{ github.ref_name }}
115 head-ref: ${{ github.sha }}
116 - name: Pull Request Dependency Review
117 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
118 uses: actions/dependency-review-action@v4
119 - uses: pnpm/action-setup@v4
120 - name: Setup node ${{ matrix.node }}
121 uses: actions/setup-node@v4
123 node-version: ${{ matrix.node }}
126 run: pnpm install --ignore-scripts --frozen-lockfile
128 # if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
129 # run: pnpm audit --prod
131 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
137 - name: pnpm coverage
138 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
140 - name: SonarCloud Scan
141 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' }}
142 uses: sonarsource/sonarcloud-github-action@v3.0.0
144 projectBaseDir: ui/web
146 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
148 build-simulator-docker-image:
149 runs-on: ubuntu-latest
150 name: Build simulator docker image
152 - uses: actions/checkout@v4
153 - name: Setup Docker Buildx
155 uses: docker/setup-buildx-action@v3
156 - name: Build docker image
159 make SUBMODULES_INIT=false
160 build-dashboard-docker-image:
161 runs-on: ubuntu-latest
164 working-directory: ui/web
165 name: Build dashboard docker image
167 - uses: actions/checkout@v4
168 - name: Setup Docker Buildx
170 uses: docker/setup-buildx-action@v3
171 - name: Build docker image
174 make SUBMODULES_INIT=false