|
14 | 14 | type: string |
15 | 15 | required: true |
16 | 16 | e2e-matrix: |
17 | | - description: "JSON array of E2E test matrix entries" |
18 | | - type: string |
19 | | - required: true |
20 | | - e2e-infra-matrix: |
21 | | - description: "JSON array of E2E infra test matrix entries" |
| 17 | + description: "JSON array of E2E test matrix entries (includes both regular and infra)" |
22 | 18 | type: string |
23 | 19 | required: true |
24 | 20 |
|
@@ -58,16 +54,229 @@ jobs: |
58 | 54 | - uses: ./.github/actions/prepare-bundled-assets |
59 | 55 |
|
60 | 56 | # ════════════════════════════════════════════════════════════════════ |
61 | | - # Quality gates (Elasticsearch, standard browsers) |
| 57 | + # Static quality checks |
| 58 | + # ════════════════════════════════════════════════════════════════════ |
| 59 | + |
| 60 | + spotless-check: |
| 61 | + name: "🔍 Spotless Check" |
| 62 | + runs-on: ubuntu-latest |
| 63 | + timeout-minutes: 10 |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v7 |
| 66 | + - uses: ./.github/actions/spotless-check |
| 67 | + |
| 68 | + frontend-quality: |
| 69 | + name: "🧪 Frontend Quality & Unit Tests" |
| 70 | + runs-on: ubuntu-latest |
| 71 | + timeout-minutes: 20 |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v7 |
| 74 | + - uses: ./.github/actions/frontend-quality |
| 75 | + |
| 76 | + # ════════════════════════════════════════════════════════════════════ |
| 77 | + # API Tests — matrix passed from caller |
| 78 | + # ════════════════════════════════════════════════════════════════════ |
| 79 | + |
| 80 | + api-tests: |
| 81 | + name: "🧪 API Tests (${{ matrix.shard_name }})" |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 30 |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + include: ${{ fromJSON(inputs.api-matrix) }} |
| 88 | + env: |
| 89 | + EXPLICITLY_SHARDED_TESTS: |- |
| 90 | + io/openaev/api/**/*Test.java |
| 91 | + io/openaev/integration/**/*Test.java |
| 92 | + io/openaev/injects/**/*Test.java |
| 93 | + io/openaev/opencti/**/*Test.java |
| 94 | + io/openaev/service/**/*Test.java |
| 95 | + io/openaev/rest/**/*Test.java |
| 96 | + SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/openaev |
| 97 | + SPRING_DATASOURCE_USERNAME: openaev |
| 98 | + SPRING_DATASOURCE_PASSWORD: openaev |
| 99 | + MINIO_ENDPOINT: localhost |
| 100 | + MINIO_PORT: 11000 |
| 101 | + ENGINE_URL: http://localhost:9200 |
| 102 | + ENGINE_ENGINESELECTOR: ${{ matrix.engine_selector }} |
| 103 | + OPENBAS_RABBITMQ_HOSTNAME: localhost |
| 104 | + GH_TOKEN: ${{ github.token }} |
| 105 | + steps: |
| 106 | + - uses: actions/checkout@v7 |
| 107 | + - uses: ./.github/actions/api-tests |
| 108 | + with: |
| 109 | + includes: ${{ matrix.includes }} |
| 110 | + excludes: ${{ matrix.excludes }} |
| 111 | + shard: ${{ matrix.shard }} |
| 112 | + shard-name: ${{ matrix.shard_name }} |
| 113 | + search-engine: ${{ matrix.search_engine }} |
| 114 | + artifact-suffix: ${{ matrix.artifact_suffix }} |
| 115 | + |
| 116 | + # ════════════════════════════════════════════════════════════════════ |
| 117 | + # E2E Tests — matrix passed from caller |
| 118 | + # ════════════════════════════════════════════════════════════════════ |
| 119 | + |
| 120 | + e2e-tests: |
| 121 | + name: "🧪 E2E (${{ matrix.variant }} ${{ matrix.project }}${{ matrix.artifact_suffix }})" |
| 122 | + runs-on: ${{ matrix.runner }} |
| 123 | + timeout-minutes: 45 |
| 124 | + strategy: |
| 125 | + fail-fast: false |
| 126 | + matrix: |
| 127 | + include: ${{ fromJSON(inputs.e2e-matrix) }} |
| 128 | + env: |
| 129 | + SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/openaev |
| 130 | + SPRING_DATASOURCE_USERNAME: openaev |
| 131 | + SPRING_DATASOURCE_PASSWORD: openaev |
| 132 | + MINIO_ENDPOINT: localhost |
| 133 | + MINIO_PORT: 11000 |
| 134 | + MINIO_ACCESS_KEY: minioadmin |
| 135 | + MINIO_ACCESS_SECRET: minioadmin |
| 136 | + ENGINE_URL: http://localhost:9200 |
| 137 | + ENGINE_ENGINESELECTOR: ${{ matrix.search_engine == 'opensearch' && 'opensearch' || 'elk' }} |
| 138 | + OPENBAS_RABBITMQ_HOSTNAME: localhost |
| 139 | + OPENAEV_ADMIN_EMAIL: admin@openaev.io |
| 140 | + OPENAEV_ADMIN_PASSWORD: admin |
| 141 | + OPENAEV_ADMIN_TOKEN: 0d17ce9a-f3a8-4c6d-9721-c98dc3dc023f |
| 142 | + OPENAEV_ADMIN_ENCRYPTION_KEY: ThisIsMyUltraSecureEncryptionKey |
| 143 | + OPENAEV_ADMIN_ENCRYPTION_SALT: ilikesaltyfoodnomnom |
| 144 | + SPRING_PROFILES_ACTIVE: ci |
| 145 | + OPENAEV_APPLICATION_LICENSE: ${{ secrets.OPENAEV_APPLICATION_LICENSE }} |
| 146 | + GH_TOKEN: ${{ github.token }} |
| 147 | + steps: |
| 148 | + - uses: actions/checkout@v7 |
| 149 | + - uses: ./.github/actions/e2e-tests |
| 150 | + with: |
| 151 | + browser: ${{ matrix.browser }} |
| 152 | + project: ${{ matrix.project }} |
| 153 | + docker-image: ${{ matrix.docker_image }} |
| 154 | + search-engine: ${{ matrix.search_engine }} |
| 155 | + artifact-suffix: ${{ matrix.artifact_suffix }} |
| 156 | + |
| 157 | + # ════════════════════════════════════════════════════════════════════ |
| 158 | + # API Types Check |
| 159 | + # ════════════════════════════════════════════════════════════════════ |
| 160 | + |
| 161 | + api-types-check: |
| 162 | + name: "🔎 API Types Check" |
| 163 | + runs-on: ubuntu-latest |
| 164 | + timeout-minutes: 20 |
| 165 | + env: |
| 166 | + SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/openaev |
| 167 | + SPRING_DATASOURCE_USERNAME: openaev |
| 168 | + SPRING_DATASOURCE_PASSWORD: openaev |
| 169 | + MINIO_ENDPOINT: localhost |
| 170 | + MINIO_PORT: 11000 |
| 171 | + MINIO_ACCESS_KEY: minioadmin |
| 172 | + MINIO_ACCESS_SECRET: minioadmin |
| 173 | + ENGINE_URL: http://localhost:9200 |
| 174 | + OPENBAS_RABBITMQ_HOSTNAME: localhost |
| 175 | + OPENAEV_ADMIN_EMAIL: admin@openaev.io |
| 176 | + OPENAEV_ADMIN_PASSWORD: admin |
| 177 | + OPENAEV_ADMIN_TOKEN: 0d17ce9a-f3a8-4c6d-9721-c98dc3dc023f |
| 178 | + OPENAEV_ADMIN_ENCRYPTION_KEY: ThisIsMyUltraSecureEncryptionKey |
| 179 | + OPENAEV_ADMIN_ENCRYPTION_SALT: ilikesaltyfoodnomnom |
| 180 | + SPRING_PROFILES_ACTIVE: ci |
| 181 | + GH_TOKEN: ${{ github.token }} |
| 182 | + steps: |
| 183 | + - uses: actions/checkout@v7 |
| 184 | + - uses: ./.github/actions/api-types-check |
| 185 | + |
| 186 | + # ════════════════════════════════════════════════════════════════════ |
| 187 | + # Coverage Merge & Upload |
62 | 188 | # ════════════════════════════════════════════════════════════════════ |
63 | 189 |
|
64 | | - quality-gates: |
65 | | - uses: ./.github/workflows/_quality-gates.yml |
66 | | - with: |
67 | | - api-matrix: ${{ inputs.api-matrix }} |
68 | | - e2e-matrix: ${{ inputs.e2e-matrix }} |
69 | | - e2e-infra-matrix: ${{ inputs.e2e-infra-matrix }} |
70 | | - secrets: inherit |
| 190 | + codecov: |
| 191 | + name: "📊 Coverage Merge & Upload" |
| 192 | + needs: [api-tests, frontend-quality, e2e-tests, api-types-check] |
| 193 | + if: ${{ !cancelled() }} |
| 194 | + runs-on: ubuntu-latest |
| 195 | + timeout-minutes: 15 |
| 196 | + steps: |
| 197 | + - uses: actions/checkout@v7 |
| 198 | + |
| 199 | + - name: Set up Java 21 |
| 200 | + uses: actions/setup-java@v5 |
| 201 | + with: |
| 202 | + java-version: "21" |
| 203 | + distribution: temurin |
| 204 | + cache: maven |
| 205 | + |
| 206 | + - name: Download compiled Maven artifacts |
| 207 | + if: needs.api-tests.result == 'success' || needs.api-tests.result == 'failure' |
| 208 | + uses: actions/download-artifact@v8 |
| 209 | + with: |
| 210 | + name: backend-compiled |
| 211 | + path: ~/.m2/repository/io/openaev/ |
| 212 | + continue-on-error: true |
| 213 | + |
| 214 | + - name: Download API build output |
| 215 | + if: needs.api-tests.result == 'success' || needs.api-tests.result == 'failure' |
| 216 | + uses: actions/download-artifact@v8 |
| 217 | + with: |
| 218 | + name: api-build-output |
| 219 | + path: openaev-api/target |
| 220 | + continue-on-error: true |
| 221 | + |
| 222 | + - name: Download all JaCoCo exec shards |
| 223 | + if: needs.api-tests.result == 'success' || needs.api-tests.result == 'failure' |
| 224 | + uses: actions/download-artifact@v8 |
| 225 | + with: |
| 226 | + pattern: jacoco-exec-shard-* |
| 227 | + path: jacoco-exec |
| 228 | + continue-on-error: true |
| 229 | + |
| 230 | + - name: Merge JaCoCo exec files |
| 231 | + id: jacoco-merge |
| 232 | + if: needs.api-tests.result == 'success' || needs.api-tests.result == 'failure' |
| 233 | + run: | |
| 234 | + echo "📦 Merging JaCoCo exec files from all shards..." |
| 235 | + EXEC_FILES=$(find jacoco-exec -name 'jacoco.exec' 2>/dev/null) |
| 236 | + if [ -z "$EXEC_FILES" ]; then |
| 237 | + echo "⚠️ No JaCoCo exec files found" |
| 238 | + exit 1 |
| 239 | + fi |
| 240 | + SHARD_COUNT=$(echo "$EXEC_FILES" | wc -l) |
| 241 | + cat jacoco-exec/jacoco-exec-shard-*/jacoco.exec > openaev-api/target/jacoco.exec |
| 242 | + echo "✅ Merged $SHARD_COUNT shard(s)" |
| 243 | +
|
| 244 | + - name: Coverage report & threshold check |
| 245 | + if: steps.jacoco-merge.outcome == 'success' |
| 246 | + run: mvn -B -ntp -pl openaev-api jacoco:report jacoco:check || echo "⚠️ Coverage threshold check ⚠️" |
| 247 | + |
| 248 | + - name: Upload API coverage |
| 249 | + if: ${{ !cancelled() && steps.jacoco-merge.outcome == 'success' }} |
| 250 | + uses: actions/upload-artifact@v7 |
| 251 | + with: |
| 252 | + name: jacoco-api |
| 253 | + path: openaev-api/target/site/jacoco/jacoco.xml |
| 254 | + if-no-files-found: warn |
| 255 | + |
| 256 | + - name: Download vitest coverage |
| 257 | + if: ${{ needs.frontend-quality.result == 'success' }} |
| 258 | + uses: actions/download-artifact@v8 |
| 259 | + with: |
| 260 | + name: vitest-coverage |
| 261 | + path: coverage/frontend |
| 262 | + continue-on-error: true |
| 263 | + |
| 264 | + - name: Download playwright coverage |
| 265 | + if: ${{ needs.e2e-tests.result == 'success' }} |
| 266 | + uses: actions/download-artifact@v8 |
| 267 | + with: |
| 268 | + pattern: playwright-coverage-* |
| 269 | + path: coverage/e2e |
| 270 | + merge-multiple: true |
| 271 | + continue-on-error: true |
| 272 | + |
| 273 | + - name: Upload to Codecov |
| 274 | + uses: codecov/codecov-action@v7 |
| 275 | + with: |
| 276 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 277 | + flags: backend,frontend,e2e |
| 278 | + fail_ci_if_error: false |
| 279 | + continue-on-error: true |
71 | 280 |
|
72 | 281 | # ════════════════════════════════════════════════════════════════════ |
73 | 282 | # Packaging |
|
0 commit comments