name: Diff on: push: paths-ignore: - 'docs/**' - '*.md' jobs: community_build: name: "Community build" runs-on: [self-hosted, General, Linux, X64, Debian10] env: THREADS: 24 steps: - name: Set up repository uses: actions/checkout@v2 with: # Number of commits to fetch. `0` indicates all history for all # branches and tags. (default: 1) fetch-depth: 0 - name: Build community binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. ./init # Build community binaries. cd build cmake -DCMAKE_BUILD_TYPE=release -DMG_ENTERPRISE=OFF .. make -j$THREADS - name: Run unit tests run: | # Activate toolchain. source /opt/toolchain-v2/activate # Run unit tests. cd build ctest -R memgraph__unit --output-on-failure - name: Run stress test run: | cd tests/stress ./continuous_integration - name: Create community DEB package run: | # Activate toolchain. source /opt/toolchain-v2/activate # Create community DEB package. cd build mkdir output && cd output cpack -G DEB --config ../CPackConfig.cmake - name: Save community DEB package uses: actions/upload-artifact@v2 with: name: "Community DEB package" path: build/output/memgraph*.deb coverage_build: name: "Coverage build" runs-on: [self-hosted, General, Linux, X64, Debian10] env: THREADS: 24 steps: - name: Set up repository uses: actions/checkout@v2 with: # Number of commits to fetch. `0` indicates all history for all # branches and tags. (default: 1) fetch-depth: 0 - name: Build coverage binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. ./init # Build coverage binaries. cd build cmake -DTEST_COVERAGE=ON .. make -j$THREADS memgraph__unit - name: Run unit tests run: | # Activate toolchain. source /opt/toolchain-v2/activate # Run unit tests. cd build ctest -R memgraph__unit --output-on-failure - name: Compute code coverage run: | # Activate toolchain. source /opt/toolchain-v2/activate # Compute code coverage. cd tools/github ./coverage_convert # Package code coverage. cd generated tar -czf code_coverage.tar.gz coverage.json html report.json summary.rmu - name: Save code coverage uses: actions/upload-artifact@v2 with: name: "Code coverage" path: tools/github/generated/code_coverage.tar.gz debug_build: name: "Debug build" runs-on: [self-hosted, General, Linux, X64, Debian10] env: THREADS: 24 steps: - name: Set up repository uses: actions/checkout@v2 with: # Number of commits to fetch. `0` indicates all history for all # branches and tags. (default: 1) fetch-depth: 0 - name: Build debug binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. ./init # Build debug binaries. cd build cmake .. make -j$THREADS - name: Run leftover CTest tests run: | # Activate toolchain. source /opt/toolchain-v2/activate # Run leftover CTest tests (all except unit and benchmark tests). cd build ctest -E "(memgraph__unit|memgraph__benchmark)" --output-on-failure - name: Run drivers tests run: | ./tests/drivers/run.sh - name: Run integration tests run: | cd tests/integration for name in *; do if [ ! -d $name ]; then continue; fi pushd $name >/dev/null echo "Running: $name" if [ -x prepare.sh ]; then ./prepare.sh fi if [ -x runner.py ]; then ./runner.py elif [ -x runner.sh ]; then ./runner.sh fi echo popd >/dev/null done - name: Run cppcheck and clang-format run: | # Activate toolchain. source /opt/toolchain-v2/activate # Run cppcheck and clang-format. cd tools/github ./cppcheck_and_clang_format diff - name: Save cppcheck and clang-format errors uses: actions/upload-artifact@v2 with: name: "Code coverage" path: tools/github/cppcheck_and_clang_format.txt release_build: name: "Release build" runs-on: [self-hosted, General, Linux, X64, Debian10] env: THREADS: 24 steps: - name: Set up repository uses: actions/checkout@v2 with: # Number of commits to fetch. `0` indicates all history for all # branches and tags. (default: 1) fetch-depth: 0 - name: Set up parent run: | # Remove parent folder (if it exists). cd .. if [ -d parent ]; then rm -rf parent fi # Copy untouched repository to parent folder. cp -r memgraph parent # Checkout previous commit cd parent git checkout HEAD~1 - name: Build release binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. ./init # Build release binaries. cd build cmake -DCMAKE_BUILD_TYPE=release .. make -j$THREADS - name: Build parent binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. cd ../parent ./init # Build parent binaries. cd build cmake -DCMAKE_BUILD_TYPE=release .. make -j$THREADS memgraph memgraph__macro_benchmark - name: Run macro benchmark tests run: | cd tests/macro_benchmark ./harness QuerySuite MemgraphRunner \ --groups aggregation 1000_create unwind_create dense_expand match \ --no-strict - name: Run parent macro benchmark tests run: | cd ../parent/tests/macro_benchmark ./harness QuerySuite MemgraphRunner \ --groups aggregation 1000_create unwind_create dense_expand match \ --no-strict - name: Compute macro benchmark summary run: | ./tools/github/macro_benchmark_summary \ --current tests/macro_benchmark/.harness_summary \ --previous ../parent/tests/macro_benchmark/.harness_summary \ --output macro_benchmark_summary.txt - name: Save macro benchmark summary uses: actions/upload-artifact@v2 with: name: "Macro benchmark summary" path: macro_benchmark_summary.txt - name: Run GQL Behave tests run: | cd tests/gql_behave ./continuous_integration - name: Save quality assurance status uses: actions/upload-artifact@v2 with: name: "GQL Behave Status" path: | tests/gql_behave/gql_behave_status.csv tests/gql_behave/gql_behave_status.html - name: Run stress test (plain) run: | cd tests/stress ./continuous_integration - name: Run stress test (SSL) run: | cd tests/stress ./continuous_integration --use-ssl - name: Run durability test run: | cd tests/stress source ve3/bin/activate python3 durability --num-steps 5 - name: Create enterprise DEB package run: | # Activate toolchain. source /opt/toolchain-v2/activate # Create enterprise DEB package. cd build mkdir output && cd output cpack -G DEB --config ../CPackConfig.cmake - name: Save enterprise DEB package uses: actions/upload-artifact@v2 with: name: "Enterprise DEB package" path: build/output/memgraph*.deb release_jepsen_test: name: "Release Jepsen Test" runs-on: [self-hosted, Linux, X64, Debian10, JepsenControl] continue-on-error: true env: THREADS: 24 steps: - name: Set up repository uses: actions/checkout@v2 with: # Number of commits to fetch. `0` indicates all history for all # branches and tags. (default: 1) fetch-depth: 0 - name: Build release binaries run: | # Activate toolchain. source /opt/toolchain-v2/activate # Initialize dependencies. ./init # Build only memgraph release binarie. cd build cmake -DCMAKE_BUILD_TYPE=release .. make -j$THREADS memgraph - name: Run Jepsen tests run: | cd tests/jepsen ./setup-local-docker-cluster.sh copy ../../build/memgraph # NOTE: docker exec -t is NOT ok because gh user does NOT have TTY. # NOTE: ~/.bashrc has to be manually sourced when bash -c is used # because some Jepsen config is there. docker exec jepsen-control bash -c "source ~/.bashrc && cd memgraph && lein run test-all --local-binary /opt/memgraph/memgraph --node n1" docker exec jepsen-control bash -c 'tar -czvf /jepsen/memgraph/Jepsen.tar.gz $(readlink -f /jepsen/memgraph/store/latest)' docker cp jepsen-control:/jepsen/memgraph/Jepsen.tar.gz ./ - name: Save Jepsen report uses: actions/upload-artifact@v2 with: name: "Jepsen Report" path: tests/jepsen/Jepsen.tar.gz