diff --git a/.github/workflows/db_examples_tests.yml b/.github/workflows/db_examples_tests.yml index a1a81b4d4..51ac9a82a 100644 --- a/.github/workflows/db_examples_tests.yml +++ b/.github/workflows/db_examples_tests.yml @@ -54,6 +54,10 @@ jobs: with: python-version: ${{ inputs.python-version }} + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Run Neo4j Example env: ENV: dev @@ -66,9 +70,9 @@ jobs: EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} GRAPH_DATABASE_PROVIDER: "neo4j" - GRAPH_DATABASE_URL: ${{ secrets.NEO4J_API_URL }} - GRAPH_DATABASE_USERNAME: "neo4j" - GRAPH_DATABASE_PASSWORD: ${{ secrets.NEO4J_API_KEY }} + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} run: | uv run python examples/database_examples/neo4j_example.py diff --git a/.github/workflows/graph_db_tests.yml b/.github/workflows/graph_db_tests.yml index e7e5a11b8..b07f6232f 100644 --- a/.github/workflows/graph_db_tests.yml +++ b/.github/workflows/graph_db_tests.yml @@ -71,6 +71,10 @@ jobs: with: python-version: ${{ inputs.python-version }} + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Run default Neo4j env: ENV: 'dev' @@ -83,9 +87,9 @@ jobs: EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }} EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }} GRAPH_DATABASE_PROVIDER: "neo4j" - GRAPH_DATABASE_URL: ${{ secrets.NEO4J_API_URL }} - GRAPH_DATABASE_PASSWORD: ${{ secrets.NEO4J_API_KEY }} - GRAPH_DATABASE_USERNAME: "neo4j" + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} run: uv run python ./cognee/tests/test_neo4j.py - name: Run Weighted Edges Tests with Neo4j diff --git a/.github/workflows/relational_db_migration_tests.yml b/.github/workflows/relational_db_migration_tests.yml index 26fd7e150..6a37e308e 100644 --- a/.github/workflows/relational_db_migration_tests.yml +++ b/.github/workflows/relational_db_migration_tests.yml @@ -186,6 +186,10 @@ jobs: python-version: '3.11.x' extra-dependencies: "postgres" + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Install specific db dependency run: echo "Dependencies already installed in setup" @@ -206,9 +210,9 @@ jobs: env: ENV: 'dev' GRAPH_DATABASE_PROVIDER: "neo4j" - GRAPH_DATABASE_URL: ${{ secrets.NEO4J_API_URL }} - GRAPH_DATABASE_PASSWORD: ${{ secrets.NEO4J_API_KEY }} - GRAPH_DATABASE_USERNAME: "neo4j" + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} LLM_PROVIDER: openai LLM_MODEL: ${{ secrets.LLM_MODEL }} diff --git a/.github/workflows/search_db_tests.yml b/.github/workflows/search_db_tests.yml index 0b749526d..e3e46dd97 100644 --- a/.github/workflows/search_db_tests.yml +++ b/.github/workflows/search_db_tests.yml @@ -51,20 +51,6 @@ jobs: name: Search test for Neo4j/LanceDB/Sqlite runs-on: ubuntu-22.04 if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'neo4j/lance/sqlite') }} - services: - neo4j: - image: neo4j:5.11 - env: - NEO4J_AUTH: neo4j/pleaseletmein - NEO4J_PLUGINS: '["apoc","graph-data-science"]' - ports: - - 7474:7474 - - 7687:7687 - options: >- - --health-cmd="cypher-shell -u neo4j -p pleaseletmein 'RETURN 1'" - --health-interval=10s - --health-timeout=5s - --health-retries=5 steps: - name: Check out @@ -77,6 +63,10 @@ jobs: with: python-version: ${{ inputs.python-version }} + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Dependencies already installed run: echo "Dependencies already installed in setup" @@ -94,9 +84,9 @@ jobs: GRAPH_DATABASE_PROVIDER: 'neo4j' VECTOR_DB_PROVIDER: 'lancedb' DB_PROVIDER: 'sqlite' - GRAPH_DATABASE_URL: bolt://localhost:7687 - GRAPH_DATABASE_USERNAME: neo4j - GRAPH_DATABASE_PASSWORD: pleaseletmein + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} run: uv run python ./cognee/tests/test_search_db.py run-kuzu-pgvector-postgres-search-tests: @@ -158,19 +148,6 @@ jobs: runs-on: ubuntu-22.04 if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'neo4j/pgvector/postgres') }} services: - neo4j: - image: neo4j:5.11 - env: - NEO4J_AUTH: neo4j/pleaseletmein - NEO4J_PLUGINS: '["apoc","graph-data-science"]' - ports: - - 7474:7474 - - 7687:7687 - options: >- - --health-cmd="cypher-shell -u neo4j -p pleaseletmein 'RETURN 1'" - --health-interval=10s - --health-timeout=5s - --health-retries=5 postgres: image: pgvector/pgvector:pg17 env: @@ -196,6 +173,10 @@ jobs: python-version: ${{ inputs.python-version }} extra-dependencies: "postgres" + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Dependencies already installed run: echo "Dependencies already installed in setup" @@ -213,9 +194,9 @@ jobs: GRAPH_DATABASE_PROVIDER: 'neo4j' VECTOR_DB_PROVIDER: 'pgvector' DB_PROVIDER: 'postgres' - GRAPH_DATABASE_URL: bolt://localhost:7687 - GRAPH_DATABASE_USERNAME: neo4j - GRAPH_DATABASE_PASSWORD: pleaseletmein + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} DB_NAME: cognee_db DB_HOST: 127.0.0.1 DB_PORT: 5432 diff --git a/.github/workflows/temporal_graph_tests.yml b/.github/workflows/temporal_graph_tests.yml index 4156dffff..66f7d60ee 100644 --- a/.github/workflows/temporal_graph_tests.yml +++ b/.github/workflows/temporal_graph_tests.yml @@ -51,20 +51,6 @@ jobs: name: Temporal Graph test Neo4j (lancedb + sqlite) runs-on: ubuntu-22.04 if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'neo4j/lance/sqlite') }} - services: - neo4j: - image: neo4j:5.11 - env: - NEO4J_AUTH: neo4j/pleaseletmein - NEO4J_PLUGINS: '["apoc","graph-data-science"]' - ports: - - 7474:7474 - - 7687:7687 - options: >- - --health-cmd="cypher-shell -u neo4j -p pleaseletmein 'RETURN 1'" - --health-interval=10s - --health-timeout=5s - --health-retries=5 steps: - name: Check out @@ -77,6 +63,10 @@ jobs: with: python-version: ${{ inputs.python-version }} + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Dependencies already installed run: echo "Dependencies already installed in setup" @@ -94,9 +84,9 @@ jobs: GRAPH_DATABASE_PROVIDER: 'neo4j' VECTOR_DB_PROVIDER: 'lancedb' DB_PROVIDER: 'sqlite' - GRAPH_DATABASE_URL: bolt://localhost:7687 - GRAPH_DATABASE_USERNAME: neo4j - GRAPH_DATABASE_PASSWORD: pleaseletmein + GRAPH_DATABASE_URL: ${{ steps.neo4j.outputs.neo4j-url }} + GRAPH_DATABASE_USERNAME: ${{ steps.neo4j.outputs.neo4j-username }} + GRAPH_DATABASE_PASSWORD: ${{ steps.neo4j.outputs.neo4j-password }} run: uv run python ./cognee/tests/test_temporal_graph.py run_temporal_graph_kuzu_postgres_pgvector: diff --git a/.github/workflows/weighted_edges_tests.yml b/.github/workflows/weighted_edges_tests.yml index df5e048f2..874ef6ea4 100644 --- a/.github/workflows/weighted_edges_tests.yml +++ b/.github/workflows/weighted_edges_tests.yml @@ -86,12 +86,19 @@ jobs: with: python-version: '3.11' + - name: Setup Neo4j with GDS + uses: ./.github/actions/setup_neo4j + id: neo4j + - name: Dependencies already installed run: echo "Dependencies already installed in setup" - name: Run Weighted Edges Tests env: GRAPH_DATABASE_PROVIDER: ${{ matrix.graph_db_provider }} + GRAPH_DATABASE_URL: ${{ matrix.graph_db_provider == 'neo4j' && steps.neo4j.outputs.neo4j-url || '' }} + GRAPH_DATABASE_USERNAME: ${{ matrix.graph_db_provider == 'neo4j' && steps.neo4j.outputs.neo4j-username || '' }} + GRAPH_DATABASE_PASSWORD: ${{ matrix.graph_db_provider == 'neo4j' && steps.neo4j.outputs.neo4j-password || '' }} run: | uv run pytest cognee/tests/unit/interfaces/graph/test_weighted_edges.py -v --tb=short