Skip to content

fix rust module build directory loop #207

fix rust module build directory loop

fix rust module build directory loop #207

Workflow file for this run

name: Build and Test no
env:
PY_VERSION: "3.9"
CORE_COUNT: "8"
MAGE_CONTAINER: "mage"
MEMGRAPH_PORT: 7687
NEO4J_PORT: 7688
NEO4J_CONTAINER: "neo4j_test"
OFFICIAL: "true"
on:
push:
tags:
- "v*.*.*-rc*"
- "v*.*-rc*"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: True
env:
MEMGRAPH_VERSION: 2.16.0
strategy:
matrix:
architecture: ["amd64", "arm64"]
target: ["prod", "dev"]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Download memgraph binaries
run: |
if [ "${{ env.OFFICIAL }}" = "true" ]; then
curl -L "https://download.memgraph.com/memgraph/v${MEMGRAPH_VERSION}/debian-11/memgraph_${MEMGRAPH_VERSION}-1_amd64.deb" > memgraph-amd64.deb
curl -L "https://download.memgraph.com/memgraph/v${MEMGRAPH_VERSION}/debian-11-aarch64/memgraph_${MEMGRAPH_VERSION}-1_arm64.deb" > memgraph-arm64.deb
else
sudo apt update && sudo apt install -y ca-certificates wget git
wget -q https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph-unofficial/memgraph_${MEMGRAPH_VERSION}-1_amd64.deb -O memgraph-amd64.deb
wget -q https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph-unofficial/memgraph_${MEMGRAPH_VERSION}-1_arm64.deb -O memgraph-arm64.deb
fi
- name: Disk status before cleaning
run: |
df -h
docker buildx du
- name : Docker system prune
run : |
docker buildx prune --all -f
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /opt/hostedtoolcache
- name: Disk status after cleaning
run: |
df -h
docker buildx du
- name: Rust library tests
if: matrix.target == 'dev'
run: |
cd rust/rsmgp-sys
cargo fmt -- --check
cargo test
- name: Build and run Memgraph MAGE:${{ matrix.target }}
run: |
DOCKER_BUILDKIT=1 docker buildx build \
--tag memgraph-mage:${{ matrix.target }} \
--target ${{ matrix.target }} \
--platform linux/${{ matrix.architecture }} \
--file Dockerfile.no_ML \
--load .
docker run -d -p ${{ env.MEMGRAPH_PORT }}:7687 --name ${{ env.MAGE_CONTAINER }} memgraph-mage:${{ matrix.target }} --telemetry-enabled=False
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get all current images
run: |
docker images
- name: Set up C++
run: |
sudo apt update
sudo apt install -y build-essential cmake
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PY_VERSION }}
- name: Install Python test dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./python/tests/requirements.txt
- name: Build C++ modules
run: |
mkdir -p cpp/build
cd cpp/build
cmake ..
make -j${{ env.CORE_COUNT }}
- name: C++ Modules unit tests
if: matrix.target == 'dev'
run: |
cd cpp/build
ctest -j${{ env.CORE_COUNT }}
- name: Run End-to-end tests
if: matrix.architecture != 'arm64'
env:
PYTHONPATH: "$PWD/e2e"
run: |
cd e2e
docker exec -i -u root ${{ env.MAGE_CONTAINER }} bash -c "cd /mage/e2e/ && python3 -m pytest . -k 'not cugraph and not tgn and not link_prediction and not node_classification and not text'"
- name: Run End-to-end correctness tests
if: matrix.architecture != 'arm64'
env:
PYTHONPATH: "$PWD/e2e"
run: |
docker run --rm \
--name ${{ env.NEO4J_CONTAINER}} \
-p 7474:7474 -p ${{ env.NEO4J_PORT }}:7687 \
--rm \
-d \
-v $HOME/neo4j/plugins:/plugins \
--env NEO4J_AUTH=none \
-e NEO4J_apoc_export_file_enabled=true \
-e NEO4J_apoc_import_file_enabled=true \
-e NEO4J_apoc_import_file_use__neo4j__config=true \
-e NEO4JLABS_PLUGINS=\["apoc"\] neo4j:5.10.0
sleep 5
python3 test_e2e_correctness.py --memgraph-port ${{ env.MEMGRAPH_PORT }} --neo4j-port ${{ env.NEO4J_PORT }}
docker stop ${{ env.NEO4J_CONTAINER}}