Test Neo4j V5 #1891
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
name: Build and Test | |
env: | |
MG_VERSION: "2.17.0" | |
POETRY_VERSION: "1.2.2" | |
VM_MAX_MAP_COUNT: "262144" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, review_requested, ready_for_review] | |
workflow_dispatch: | |
jobs: | |
build_and_test_ubuntu: | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up pip and install packages | |
run: | | |
python -m pip install -U pip | |
sudo -H pip install networkx numpy scipy | |
sudo -H pip install poethepoet==0.18.1 | |
- name: Setup poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Install Memgraph | |
run: | | |
mkdir /home/runner/memgraph | |
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-20.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output /home/runner/memgraph/memgraph-community.deb | |
sudo dpkg -i /home/runner/memgraph/memgraph-community.deb | |
sudo systemctl stop memgraph | |
sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-session-inactivity-timeout=300 --data-directory="/var/lib/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --also-log-to-stderr=true --log-file=/var/log/memgraph/memgraph-ubuntu-${{ matrix.python-version }}.log' & | |
sleep 1 # Wait for Memgraph a bit. | |
- name: Install Neo4j | |
run: | | |
docker run -p 7474:7474 -p 7688:7687 -d -v $HOME/neo4j/data:/data -v $HOME/neo4j/logs:/logs -v $HOME/neo4j/import:/var/lib/neo4j/import -v $HOME/neo4j/plugins:/plugins --env NEO4J_AUTH=neo4j/test neo4j:4.4.7 | |
- name: Test project | |
run: | | |
poetry install --all-extras | |
poe install-pyg-cpu | |
poetry run pytest -vvv -m "not slow and not ubuntu and not docker" | |
- name: Use the Upload Artifact GitHub Action | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: assets-for-download | |
path: /var/log/memgraph | |
build_and_test_ubuntu_python3_11: | |
if: github.event.pull_request.draft == false | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up pip and install packages | |
run: | | |
python -m pip install -U pip | |
sudo -H pip install networkx numpy scipy | |
sudo -H pip install poethepoet==0.18.1 | |
- name: Setup poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Install Memgraph | |
run: | | |
mkdir /home/runner/memgraph | |
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-20.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output /home/runner/memgraph/memgraph-community.deb | |
sudo dpkg -i /home/runner/memgraph/memgraph-community.deb | |
sudo systemctl stop memgraph | |
sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-session-inactivity-timeout=300 --data-directory="/var/lib/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --also-log-to-stderr=true --log-file=/var/log/memgraph/memgraph-ubuntu-${{ matrix.python-version }}.log' & | |
sleep 1 # Wait for Memgraph a bit. | |
- name: Install Neo4j | |
run: | | |
docker run -p 7474:7474 -p 7688:7687 -d -v $HOME/neo4j/data:/data -v $HOME/neo4j/logs:/logs -v $HOME/neo4j/import:/var/lib/neo4j/import -v $HOME/neo4j/plugins:/plugins --env NEO4J_AUTH=neo4j/test neo4j:4.4.7 | |
- name: Test project | |
run: | | |
poetry install --extras "arrow docker" | |
poetry run pytest -vvv -m "not slow and not ubuntu and not docker and not dgl" | |
- name: Use the Upload Artifact GitHub Action | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: assets-for-download | |
path: /var/log/memgraph | |
build_and_test_windows: | |
if: false | |
# if: github.event.pull_request.draft == false | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
os: [windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up pip and install packages | |
run: | | |
python -m pip install -U pip | |
python -m pip install networkx numpy scipy | |
python -m pip install poethepoet==0.18.1 | |
- name: Set default WSL version to 2 | |
run: wsl --set-default-version 2 | |
- uses: Vampire/setup-wsl@v3 | |
with: | |
distribution: Ubuntu-22.04 | |
- name: Update vm.max_map_count | |
shell: wsl-bash {0} #root shell | |
run: sysctl -w vm.max_map_count=${{ env.VM_MAX_MAP_COUNT }} | |
- name: Download, install and run Memgraph under WSL | |
shell: wsl-bash {0} # root shell | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install python3 python3-pip ipython3 | |
pip3 install networkx numpy scipy | |
mkdir /memgraph | |
curl -L https://download.memgraph.com/memgraph/v${{env.MG_VERSION}}/ubuntu-22.04/memgraph_${{env.MG_VERSION}}-1_amd64.deb --output /memgraph/memgraph-community.deb | |
systemctl mask memgraph | |
dpkg -i /memgraph/memgraph-community.deb | |
mkdir /mnt/c/memgraph | |
runuser -l memgraph -c '/usr/lib/memgraph/memgraph --bolt-port 7687 --bolt-session-inactivity-timeout=300 --data-directory="/mnt/c/memgraph/data" --storage-properties-on-edges=true --storage-snapshot-interval-sec=0 --storage-wal-enabled=false --storage-recover-on-startup=false --storage-snapshot-on-exit=false --telemetry-enabled=false --log-level=TRACE --also-log-to-stderr=true --log-file=/mnt/c/memgraph/memgraph-windows-${{ matrix.python-version }}.log' & | |
sleep 1 # Wait for Memgraph a bit. | |
- name: Download, install and run Neo4j under WSL | |
shell: wsl-bash {0} # root shell | |
run: | | |
curl -fsSL https://debian.neo4j.com/neotechnology.gpg.key | apt-key add - | |
add-apt-repository "deb https://debian.neo4j.com stable 4.2" | |
sudo apt-get -y install neo4j=1:4.2.1 | |
neo4j-admin set-initial-password test | |
mkdir -p /mnt/c/neo4j/${{ matrix.python-version }} | |
sed -i 's/#dbms.connector.bolt.listen_address=:7687/dbms.connector.bolt.listen_address=:7688/g' /etc/neo4j/neo4j.conf | |
sed -i 's/#dbms.connector.bolt.advertised_address=:7687/dbms.connector.bolt.advertised_address=:7688/g' /etc/neo4j/neo4j.conf | |
sed -i 's/#dbms.default_listen_address=0.0.0.0/dbms.default_listen_address=0.0.0.0/g' /etc/neo4j/neo4j.conf | |
sed -i 's/dbms.directories.logs=\/var\/log\/neo4j/dbms.directories.logs=\/mnt\/c\/neo4j\/${{ matrix.python-version }}/g' /etc/neo4j/neo4j.conf | |
cp /etc/neo4j/neo4j.conf /mnt/c/neo4j/${{ matrix.python-version }}/neo4j.conf | |
sudo service neo4j start | |
sleep 10 # Wait for Neo4j a bit. | |
- name: Setup poetry | |
uses: abatilo/actions-poetry@v2.0.0 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: Test project | |
run: | | |
poetry install --all-extras | |
poe install-pyg-cpu | |
poetry run pytest -vvv -m "not slow and not ubuntu and not docker" | |
- name: Save Memgraph Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: memgraph-log | |
path: C:\memgraph | |
- name: Save Neo4j Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: neo4j-log | |
path: C:\neo4j |