Skip to content

Commit

Permalink
Enable ccache for building and fix dockerfile for gflags
Browse files Browse the repository at this point in the history
Update docker hub url

Use tmpfs for ccache

Limit 1G tmpfs size

Use container env to simplify steps environment variables

Add centos6 job

Fix ccache dir in centos6

Specify CC/CXX environment variables to fix node error

Fix env var

Try to fix cmake error

Add centos cache job again

Fix cache key and restore keys

Fix echo string error

Update ccache directory

Remove write ccache conf cmd

Format

Use common job env

Fix centos6 job

Use LD_LIBRARY_PATH to fix centos 6 dep error of node 12

Setup node version

Test customed actions

Fix no cache for apk installation

Try to fix entrypoint

Fix entrypoint

Use docker container to cache

Use docker to run build and test

Use sudo to mount tmpfs

Fix tty error

Fix tmpfs mount point

Fix mount error

Delete cache actions
  • Loading branch information
yixinglu committed Dec 26, 2019
1 parent 2c776d6 commit fe96c30
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 100 deletions.
107 changes: 24 additions & 83 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- 'docs/**'

jobs:
build-gcc:
name: build-gcc
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -18,90 +18,31 @@ jobs:
- centos7
- ubuntu1604
- ubuntu1804
container:
image: vesoft/nebula-dev:${{ matrix.tag }}
compiler: [gcc, clang]
exclude:
- tag: centos6
compiler: clang
- tag: centos7
compiler: clang
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: cmake
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
- name: Mount tmpfs
run: |
mkdir _build && cd _build
${NEBULA_DEP_BIN}/cmake -DCMAKE_C_COMPILER=${NEBULA_DEP_BIN}/gcc -DCMAKE_CXX_COMPILER=${NEBULA_DEP_BIN}/g++ -DCMAKE_BUILD_TYPE=Release ..
shell: bash
- name: make
env:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build && make -j $(nproc)
shell: bash
- name: test in multithreads
timeout-minutes: 20
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build
${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure
shell: bash
- name: test in singlethread
if: failure()
timeout-minutes: 40
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build
${NEBULA_DEP_BIN}/ctest --output-on-failure
shell: bash
build-clang:
name: build-clang
runs-on: ubuntu-latest
strategy:
matrix:
tag:
- ubuntu1604
- ubuntu1804
container:
image: vesoft/nebula-dev:${{ matrix.tag }}
steps:
- uses: actions/checkout@v1
mkdir -p ${{ github.workspace }}/.cache
sudo mount -t tmpfs -o size=1G tmpfs ${{ github.workspace }}/.cache
- uses: actions/cache@v1
with:
fetch-depth: 1
- name: cmake
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
mkdir _build && cd _build
${NEBULA_DEP_BIN}/cmake -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DENABLE_ASAN=on -DENABLE_UBSAN=on ..
shell: bash
- name: make
env:
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build && make -j $(nproc)
shell: bash
- name: test in multithreads
timeout-minutes: 20
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build
${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure
shell: bash
- name: test in singlethread
if: failure()
timeout-minutes: 40
env:
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
run: |
cd _build
${NEBULA_DEP_BIN}/ctest --output-on-failure
shell: bash

path: ${{ github.workspace }}/.cache/ccache
key: ${{ matrix.tag }}-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ matrix.tag }}-${{ matrix.compiler }}-
- name: Build and test
timeout-minutes: 80
run: |
docker run --rm \
-v ${{ github.workspace }}:/home/nebula \
-e CCACHE_DIR=/home/nebula/.cache/ccache \
--entrypoint ./ci/scripts/build-and-test-${{ matrix.compiler }}.sh \
vesoft/nebula-dev:${{ matrix.tag }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ _build.log
_install
install_manifest.txt

# ccls
# lsp
.ccls
.ccls-cache
compile_commands.json

src/common/base/Base.h.gch
Expand All @@ -37,3 +38,4 @@ pids/
cmake-build-debug/
cmake-build-release/
.vscode/
.ccache/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="https://github.com/vesoft-inc/nebula/actions?workflow=build">
<img src="https://github.com/vesoft-inc/nebula/workflows/build/badge.svg" alt="build and test workflow"/>
</a>
<a href="https://github.com/vesoft-inc/nebula/actions?workflow=docker">
<a href="https://hub.docker.com/u/vesoft">
<img src="https://github.com/vesoft-inc/nebula/workflows/docker/badge.svg" alt="build docker image workflow"/>
</a>
<a href="https://github.com/vesoft-inc/nebula/actions?workflow=package">
Expand Down
17 changes: 17 additions & 0 deletions ci/scripts/build-and-test-clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.

set -ex

export NEBULA_DEP_BIN=/opt/nebula/third-party/bin
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}

mkdir -p build && cd build

${NEBULA_DEP_BIN}/cmake -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DENABLE_ASAN=on -DENABLE_UBSAN=on ..
make -j $(nproc)
${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure
17 changes: 17 additions & 0 deletions ci/scripts/build-and-test-gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.

set -ex

export NEBULA_DEP_BIN=/opt/nebula/third-party/bin
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}

mkdir -p build && cd build

${NEBULA_DEP_BIN}/cmake -DCMAKE_C_COMPILER=${NEBULA_DEP_BIN}/gcc -DCMAKE_CXX_COMPILER=${NEBULA_DEP_BIN}/g++ -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc)
${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure
6 changes: 1 addition & 5 deletions docker/Dockerfile.graphd
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ RUN rpm -ivh *.rpm \

EXPOSE 3699 13000 13002

ENTRYPOINT ["./bin/nebula-graphd", \
"--flagfile=./etc/nebula-graphd.conf", \
"--daemonize=false", \
"--v=0", \
"--minloglevel=2"]
ENTRYPOINT ["./bin/nebula-graphd", "--flagfile=./etc/nebula-graphd.conf", "--daemonize=false"]
6 changes: 1 addition & 5 deletions docker/Dockerfile.metad
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ RUN rpm -ivh *.rpm \

EXPOSE 45500 45501 11000 11002

ENTRYPOINT ["./bin/nebula-metad", \
"--flagfile=./etc/nebula-metad.conf", \
"--daemonize=false", \
"--v=0", \
"--minloglevel=2"]
ENTRYPOINT ["./bin/nebula-metad", "--flagfile=./etc/nebula-metad.conf", "--daemonize=false"]
6 changes: 1 addition & 5 deletions docker/Dockerfile.storaged
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ RUN rpm -ivh *.rpm \

EXPOSE 44500 44501 12000 12002

ENTRYPOINT ["./bin/nebula-storaged", \
"--flagfile=./etc/nebula-storaged.conf", \
"--daemonize=false", \
"--v=0", \
"--minloglevel=2"]
ENTRYPOINT ["./bin/nebula-storaged", "--flagfile=./etc/nebula-storaged.conf", "--daemonize=false"]

0 comments on commit fe96c30

Please sign in to comment.