Skip to content

Commit 3310cdc

Browse files
committed
minor #1673 [CI] Auto-discover store bridges with integration tests in CI matrix (OskarStark)
This PR was merged into the main branch. Discussion ---------- [CI] Auto-discover store bridges with integration tests in CI matrix | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Instead of maintaining a hardcoded list of store bridges in the `store-bridges-integration` job, dynamically detect which bridges have integration tests by scanning for the `#[Group('integration')]` attribute. This way a new bridge with integration tests is automatically picked up without needing to update the workflow file. `@chr`-hertel I need to check if real all of them got caught, lets run the CI, check and only merge if that's the case ⚠️ Commits ------- 7034eb8 [Store] Auto-discover store bridges with integration tests in CI matrix
2 parents 8af0635 + 7034eb8 commit 3310cdc

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

.github/workflows/build-matrix.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
store-bridges:
1616
description: 'List of store bridges'
1717
value: ${{ jobs.matrix.outputs.store-bridges }}
18+
store-bridges-integration:
19+
description: 'List of store bridges with integration tests'
20+
value: ${{ jobs.matrix.outputs.store-bridges-integration }}
1821
store-bridges-include:
1922
description: 'Store bridges includes for test matrix'
2023
value: ${{ jobs.matrix.outputs.store-bridges-include }}
@@ -52,6 +55,7 @@ jobs:
5255
packages-include: ${{ steps.set-matrix.outputs.packages-include }}
5356
bridges: ${{ steps.set-matrix.outputs.bridges }}
5457
store-bridges: ${{ steps.set-matrix.outputs.store-bridges }}
58+
store-bridges-integration: ${{ steps.set-matrix.outputs.store-bridges-integration }}
5559
store-bridges-include: ${{ steps.set-matrix.outputs.store-bridges-include }}
5660
tool-bridges: ${{ steps.set-matrix.outputs.tool-bridges }}
5761
tool-bridges-include: ${{ steps.set-matrix.outputs.tool-bridges-include }}
@@ -90,6 +94,16 @@ jobs:
9094
# Bridges
9195
STORE_BRIDGES=$(ls -1 src/store/src/Bridge/ | sort \
9296
| jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "store", type: "Store", bridge: .})')
97+
98+
# Store bridges with integration tests (detected via #[Group('integration')] attribute)
99+
STORE_BRIDGES_INTEGRATION=$(for bridge in src/store/src/Bridge/*/; do
100+
name=$(basename "$bridge")
101+
if grep -rl "#\[Group('integration')\]" "$bridge" --include="*.php" > /dev/null 2>&1; then
102+
echo "$name"
103+
fi
104+
done | sort | jq -R -s -c 'split("\n") | map(select(length > 0))')
105+
echo "store-bridges-integration=$STORE_BRIDGES_INTEGRATION" >> $GITHUB_OUTPUT
106+
93107
TOOL_BRIDGES=$(ls -1 src/agent/src/Bridge/ | sort \
94108
| jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "agent", type: "Tool", bridge: .})')
95109
PLATFORM_BRIDGES=$(ls -1 src/platform/src/Bridge/ | sort \

.github/workflows/tests.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,7 @@ jobs:
137137
strategy:
138138
fail-fast: false
139139
matrix:
140-
bridge:
141-
- ChromaDb
142-
- ClickHouse
143-
- Elasticsearch
144-
- ManticoreSearch
145-
- MariaDb
146-
- Meilisearch
147-
- Milvus
148-
- Neo4j
149-
- OpenSearch
150-
- Postgres
151-
- Qdrant
152-
- Redis
153-
- SurrealDb
154-
- Typesense
155-
- Vektor
156-
- Weaviate
140+
bridge: ${{ fromJson(needs.matrix.outputs.store-bridges-integration) }}
157141

158142
steps:
159143
- name: Checkout

0 commit comments

Comments
 (0)