Skip to content

Fix linux build

Fix linux build #302

Workflow file for this run

name: CI
on: [push]
jobs:
build_and_test_ubuntu:
strategy:
matrix:
platform: [ubuntu-20.04, ubuntu-22.04]
mgversion: [2.19.0]
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/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-2022]
target: [x86_64-pc-windows-gnu]
arch:
- { mingw: 64, msys: x86_64 }
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 }}