Skip to content

Merge pull request #81 from memgraph/Add-action-for-publishing-mgconsole #399

Merge pull request #81 from memgraph/Add-action-for-publishing-mgconsole

Merge pull request #81 from memgraph/Add-action-for-publishing-mgconsole #399

Workflow file for this run

name: CI
on:
push:
workflow_dispatch:
env:
OFFICIAL: true
jobs:
build_and_test_ubuntu:
strategy:
matrix:
platform: [ubuntu-22.04]
mg_version:
- "2.19.0"
runs-on: ${{ matrix.platform }}
steps:
- name: Set up and check memgraph download link
run: |
mg_version=${{ matrix.mg_version }}
mg_version_short=${mg_version%%-*}
if [ "${{ env.OFFICIAL }}" = "true" ]; then
mg_url="https://download.memgraph.com/memgraph/v${mg_version}/${{ matrix.platform }}/memgraph_${mg_version_short}-1_amd64.deb"
else
mg_url="https://s3.eu-west-1.amazonaws.com/deps.memgraph.io/memgraph/v${mg_version}/${{ matrix.platform }}/memgraph_${mg_version_short}-1_amd64.deb"
fi
echo "Checking Memgraph download link: $mg_url"
if curl --output /dev/null --silent --head --fail $mg_url; then
echo "Memgraph download link is valid"
echo "MEMGRAPH_DOWNLOAD_LINK=${mg_url}" >> $GITHUB_ENV
else
echo "Memgraph download link is not valid"
exit 1
fi
- name: Install dependencies (Ubuntu 22.04)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt install -y git cmake make gcc g++ libssl-dev # mgconsole deps
sudo apt install -y libpython3.10 python3-pip # memgraph deps
mkdir ~/memgraph
curl -L ${{ env.MEMGRAPH_DOWNLOAD_LINK }} > ~/memgraph/memgraph_${{ matrix.mg_version }}-1_amd64.deb
sudo systemctl mask memgraph
sudo dpkg -i ~/memgraph/memgraph_${{ matrix.mg_version }}-1_amd64.deb
- uses: actions/checkout@v4
- name: Install and test mgconsole
run: |
mkdir build
cd build
cmake ..
make
sudo make install
ctest --verbose
- name: Save mgconsole test results
if: always()
uses: actions/upload-artifact@v4
with:
name: "mgconsole_ctest.log"
path: build/Testing/Temporary/LastTest.log
build_windows_mingw:
runs-on: windows-2022
strategy:
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 }
]
defaults:
run:
shell: msys2 {0}
steps:
- name: Set-up repository
uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
git base-devel
mingw-w64-${{ matrix.arch }}-toolchain
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-openssl
- name: Build and install mgconsole
run: |
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
make install
- name: Save mgconsole Windows build
uses: actions/upload-artifact@v4
with:
name: "mgconsole Windows build"
path: build/src/mgconsole.exe
build_apple:
strategy:
matrix:
platform: [macos-14]
runs-on: ${{ matrix.platform }}
steps:
- name: Set-up repository
uses: actions/checkout@v4
# NOTE: CI can't execute end2end tests because there is no way to run
# Memgraph on CI MacOS machines.
- name: Install openssl
run: |
brew update
brew install openssl
- name: Build mgconsole
run: |
mkdir build
cd build
cmake -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DCMAKE_BUILD_TYPE=Release ..
make
- name: Save mgconsole MacOS build
uses: actions/upload-artifact@v4
with:
name: "mgconsole MacOS build"
path: build/src/mgconsole