This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OGM-1591 Test with remote Neo4j on GitHub
fix
- Loading branch information
Showing
1 changed file
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ jobs: | |
retention-days: 7 | ||
|
||
test_remote_mongodb: | ||
name: Test remote mongodb instance | ||
name: Test remote MongoDb instance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout default branch | ||
|
@@ -98,3 +98,121 @@ jobs: | |
name: reports-db-ogm | ||
path: './**/build/reports/' | ||
retention-days: 7 | ||
|
||
test_neo4j_bolt_protocol: | ||
name: Test Neo4j Bolt protocol | ||
env: | ||
HTTP_NEO4J_PORT: 7777 | ||
BOLT_NEO4J_PORT: 7687 | ||
# Checked by the source code | ||
NEO4J_HOSTNAME: localhost | ||
NEO4J_PORT: 7687 | ||
NEO4J_USERNAME: neo4j | ||
NEO4J_PASSWORD: jenkins | ||
runs-on: ubuntu-latest | ||
services: | ||
neo4j: | ||
image: neo4j:3.4 | ||
ports: | ||
- 7777:7474 | ||
- 7687:7687 | ||
steps: | ||
- name: Checkout default branch | ||
uses: actions/checkout@v2 | ||
- name: Get year/month for cache key | ||
id: get-date | ||
run: | | ||
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")" | ||
shell: bash | ||
- name: Set up JDK 8 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
# https://github.com/actions/cache/blob/main/examples.md#java---maven | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Set up Maven | ||
run: ./mvnw -v | ||
# A new Neo4j instance will set the credentials for the admin to neo4j:neo4j. we change them to check | ||
# that the tests will pass when we are not using the defaults | ||
- name: Set Neo4j credentials | ||
run: | | ||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic `echo -n 'neo4j:neo4j' | base64`" -d "{\"password\":\"$NEO4J_PASSWORD\"}" http://localhost:$HTTP_NEO4J_PORT/user/neo4j/password | ||
- name: Validate Neo4j credentials | ||
run: | | ||
curl --user $NEO4J_USERNAME:$NEO4J_PASSWORD http://localhost:$HTTP_NEO4J_PORT/db/data | ||
- name: Test Bolt protocol | ||
run: | | ||
./mvnw verify -pl neo4j -s settings-example.xml -Pneo4j-bolt -am | ||
- name: Upload build reports (if build failed) | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: reports-db-ogm | ||
path: './**/build/reports/' | ||
retention-days: 7 | ||
|
||
test_neo4j_http_protocol: | ||
name: Test Neo4j Http protocol | ||
env: | ||
HTTP_NEO4J_PORT: 7777 | ||
BOLT_NEO4J_PORT: 7687 | ||
# Checked by the source code | ||
NEO4J_HOSTNAME: localhost | ||
NEO4J_PORT: 7777 | ||
NEO4J_USERNAME: neo4j | ||
NEO4J_PASSWORD: jenkins | ||
runs-on: ubuntu-latest | ||
services: | ||
neo4j: | ||
image: neo4j:3.4 | ||
ports: | ||
- 7777:7474 | ||
- 7687:7687 | ||
steps: | ||
- name: Checkout default branch | ||
uses: actions/checkout@v2 | ||
- name: Get year/month for cache key | ||
id: get-date | ||
run: | | ||
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")" | ||
shell: bash | ||
- name: Set up JDK 8 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
# https://github.com/actions/cache/blob/main/examples.md#java---maven | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Set up Maven | ||
run: ./mvnw -v | ||
# A new Neo4j instance will set the credentials for the admin to neo4j:neo4j. we change them to check | ||
# that the tests will pass when we are not using the defaults | ||
- name: Set Neo4j credentials | ||
run: | | ||
curl -X POST -H "Content-Type: application/json" -H "Authorization: Basic `echo -n 'neo4j:neo4j' | base64`" -d "{\"password\":\"$NEO4J_PASSWORD\"}" http://localhost:$HTTP_NEO4J_PORT/user/neo4j/password | ||
- name: Validate Neo4j credentials | ||
run: | | ||
curl --user $NEO4J_USERNAME:$NEO4J_PASSWORD http://localhost:$HTTP_NEO4J_PORT/db/data | ||
- name: Test Bolt protocol | ||
run: | | ||
./mvnw verify -pl neo4j -s settings-example.xml -Pneo4j-http -am | ||
- name: Upload build reports (if build failed) | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ failure() || cancelled() }} | ||
with: | ||
name: reports-db-ogm | ||
path: './**/build/reports/' | ||
retention-days: 7 |