-
Notifications
You must be signed in to change notification settings - Fork 6
133 lines (113 loc) · 3.91 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
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI
on: [push]
jobs:
build_and_test_ubuntu:
strategy:
matrix:
platform: [ubuntu-20.04, ubuntu-22.04]
mgversion: [2.16.1]
runs-on: ${{ matrix.platform }}
steps:
- name: Install system dependencies
run: sudo apt-get install -y git cmake make gcc g++ libssl-dev
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache Memgraph Docker image
id: cache-memgraph-community-docker
uses: actions/cache@v1
with:
path: ~/memgraph
key: cache-memgraph-v${{ matrix.mgversion }}-docker-image
- name: Download Memgraph Docker image
if: steps.cache-memgraph-community-docker.outputs.cache-hit != 'true'
run: |
mkdir ~/memgraph
curl -L https://download.memgraph.com/memgraph/v${{ matrix.mgversion }}/docker/memgraph-${{ matrix.mgversion }}-docker.tar.gz > ~/memgraph/memgraph-docker.tar.gz
- name: Load Memgraph Docker image
run: docker load -i ~/memgraph/memgraph-docker.tar.gz
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run rust linter
run: cargo clippy
- name: Run rust formatter
run: cargo fmt -- --check
- name: Build the project
run: cargo build --verbose
- name: Run Memgraph
run: |
docker run -d -p 7687:7687 memgraph --telemetry-enabled=False
- name: Run test
run: cargo test
build_centos:
runs-on: ubuntu-latest
container:
image: centos:8
steps:
- name: Modify repo files of centos image
run: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: Install dependencies
run: |
yum install -y git cmake make gcc gcc-c++ openssl-devel epel-release clang
- name: Install rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- uses: actions/checkout@v2
with:
submodules: true
- name: Build the project
run: |
. "$HOME/.cargo/env"
cargo build --release
build_macos:
strategy:
matrix:
platform: [macos-latest]
target: [x86_64-apple-darwin]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
sh rustup-init.sh -y --default-toolchain none
rustup target add ${{ matrix.target }}
- uses: actions/checkout@v2
with:
submodules: true
- name: Build the client
run: cargo build --release
build_windows:
strategy:
matrix:
platform: [windows-2019]
target: [x86_64-pc-windows-gnu]
arch:
- { mingw: 64, msys: x86_64 }
mgversion: [1.5]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Rustup using win.rustup.rs
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
rustup target add ${{ matrix.target }}
del rustup-init.exe
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW${{ matrix.arch.mingw }}
update: true
install: git mingw-w64-${{ matrix.arch.msys }}-toolchain mingw-w64-${{ matrix.arch.msys }}-cmake mingw-w64-${{ matrix.arch.msys }}-openssl
- name: Add mingw${{ matrix.arch.mingw }} to PATH
run: |
echo "C:/msys64/mingw${{ matrix.arch.mingw }}/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- uses: actions/checkout@v2
with:
submodules: true
- name: Build the client
run: |
cargo build --release --target=${{ matrix.target }}