-
Notifications
You must be signed in to change notification settings - Fork 8
120 lines (115 loc) · 3.77 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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