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@v4
39 python-version: ${{ matrix.python }}
40 - name: Install Poetry
42 python -m pip install --upgrade pip
44 - name: Install Dependencies
45 run: poetry install --no-root
47 run: poetry run task lint
49 needs: [check-secrets]
52 os: [windows-latest, macos-latest, ubuntu-latest]
53 node: ['20.x', 'latest']
54 name: Build simulator with Node ${{ matrix.node }} on ${{ matrix.os }}
55 runs-on: ${{ matrix.os }}
57 - uses: actions/checkout@v4
59 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
60 - name: Dependency Review
61 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
62 uses: actions/dependency-review-action@v4
64 base-ref: ${{ github.ref_name }}
65 head-ref: ${{ github.sha }}
66 - name: Pull Request Dependency Review
67 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
68 uses: actions/dependency-review-action@v4
69 - uses: pnpm/action-setup@v4
70 - name: Setup node ${{ matrix.node }}
71 uses: actions/setup-node@v4
73 node-version: ${{ matrix.node }}
76 run: pnpm install --ignore-scripts --frozen-lockfile
78 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
79 run: pnpm audit --prod
81 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
88 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
90 - name: SonarCloud Scan
91 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' }}
92 uses: sonarsource/sonarcloud-github-action@v2.2.0
94 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
97 needs: [check-secrets]
100 os: [windows-latest, macos-latest, ubuntu-latest]
101 node: ['18.x', '20.x', 'latest']
102 name: Build dashboard with Node ${{ matrix.node }} on ${{ matrix.os }}
103 runs-on: ${{ matrix.os }}
106 working-directory: ui/web
108 - uses: actions/checkout@v4
110 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
111 - name: Dependency Review
112 if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
113 uses: actions/dependency-review-action@v4
115 base-ref: ${{ github.ref_name }}
116 head-ref: ${{ github.sha }}
117 - name: Pull Request Dependency Review
118 if: ${{ github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
119 uses: actions/dependency-review-action@v4
120 - uses: pnpm/action-setup@v4
121 - name: Setup node ${{ matrix.node }}
122 uses: actions/setup-node@v4
124 node-version: ${{ matrix.node }}
127 run: pnpm install --ignore-scripts --frozen-lockfile
129 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
130 run: pnpm audit --prod
132 if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
138 - name: pnpm coverage
139 if: ${{ github.repository == 'sap/e-mobility-charging-stations-simulator' && matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }}
141 - name: SonarCloud Scan
142 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' }}
143 uses: sonarsource/sonarcloud-github-action@v2.2.0
145 projectBaseDir: ui/web
147 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
150 runs-on: ubuntu-latest
151 name: Build docker image
153 - uses: actions/checkout@v4
154 - name: Setup Docker Buildx
156 uses: docker/setup-buildx-action@v3
157 - name: Build docker image
160 make SUBMODULES_INIT=false