-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ccache to speed up build and fix dockerfile for gflags (#1510)
* Enable ccache for building and fix dockerfile for gflags 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 * Use self hosted runner * Improve cmake scripts * Add timeout seconds for ctest * Cleanup * Fix gcc warning for lower version * Execute cmake steps with condition * Limit ctest parallels Co-authored-by: dutor <[email protected]>
- Loading branch information
Showing
8 changed files
with
49 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,67 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
|
||
jobs: | ||
build-gcc: | ||
name: build-gcc | ||
runs-on: ubuntu-latest | ||
build: | ||
name: build | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
tag: | ||
- centos6 | ||
- centos7 | ||
- ubuntu1604 | ||
- ubuntu1804 | ||
compiler: | ||
- gcc | ||
# - clang | ||
exclude: | ||
- tag: centos6 | ||
compiler: clang | ||
- tag: centos7 | ||
compiler: clang | ||
container: | ||
image: vesoft/nebula-dev:${{ matrix.tag }} | ||
env: | ||
CCACHE_DIR: /tmp/ccache/${{ matrix.tag }}-${{ matrix.compiler }} | ||
options: --mount type=tmpfs,destination=/tmp/ccache,tmpfs-size=1073741824 -v /tmp/ccache/${{ matrix.tag }}-${{ matrix.compiler }}:/tmp/ccache/${{ matrix.tag }}-${{ matrix.compiler }} | ||
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} | ||
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} | ||
- name: Prepare environment | ||
run: | | ||
cd _build | ||
${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure | ||
[ -f "$CCACHE_DIR/ccache.conf" ] || cp ci/ccache.conf "$CCACHE_DIR" | ||
mkdir -p build | ||
- name: CMake with gcc | ||
if: matrix.compiler == 'gcc' | ||
run: cd build && cmake -DCMAKE_BUILD_TYPE=Release .. | ||
- name: CMake with clang | ||
if: matrix.compiler == 'clang' | ||
run: cd build && cmake -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DENABLE_ASAN=on -DENABLE_UBSAN=on .. | ||
shell: bash | ||
- name: test in singlethread | ||
- name: Make | ||
run: cd build && make -j $(nproc) | ||
- name: CTest with multiple threads | ||
timeout-minutes: 15 | ||
run: cd build && ctest -j 6 --timeout 300 --output-on-failure --rerun-failed | ||
- name: CTest with single thread | ||
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 | ||
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 | ||
|
||
timeout-minutes: 30 | ||
run: cd build && ctest --timeout 300 --output-on-failure --rerun-failed | ||
- name: Cleanup | ||
if: always() | ||
run: rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
max_size = 1.0G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters