Skip to content

Commit

Permalink
Use self hosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu committed Dec 27, 2019
1 parent e598b78 commit aa29907
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 33 deletions.
53 changes: 33 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
name: build

on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
build:
name: build
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
tag:
Expand All @@ -24,27 +31,33 @@ jobs:
compiler: clang
- tag: centos7
compiler: clang
container:
image: vesoft/nebula-dev:${{ matrix.tag }}
env:
CCACHE_DIR: /tmp/ccache/${{ matrix.tag }}-${{ matrix.compiler }}
NEBULA_DEP_BIN: /opt/nebula/third-party/bin
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:${LIBRARY_PATH}
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: Mount tmpfs
run: |
mkdir -p ${{ github.workspace }}/.cache
sudo mount -t tmpfs -o size=1G tmpfs ${{ github.workspace }}/.cache
- uses: actions/cache@v1
with:
path: ${{ github.workspace }}/.cache/ccache
key: ${{ matrix.tag }}-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ matrix.tag }}-${{ matrix.compiler }}-
- name: Pull dev docker image
run: docker pull vesoft/nebula-dev:${{ matrix.tag }}
- name: Build and test
timeout-minutes: 80
- name: Prepare environment
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 }}
[ -f "$CCACHE_DIR/ccache.conf" ] || cp ci/ccache.conf "$CCACHE_DIR"
mkdir -p build
- name: CMake
run: ./ci/scripts/cmake-${{ matrix.compiler }}.sh
shell: bash
- name: Make
run: cd build && make -j $(nproc)
- name: CTest with multiple threads
timeout-minutes: 15
run: cd build && ${NEBULA_DEP_BIN}/ctest -j $(nproc) --output-on-failure
- name: CTest with single thread
if: failure()
timeout-minutes: 30
run: cd build && ${NEBULA_DEP_BIN}/ctest --output-on-failure
- name: Cleanup
if: always()
run: rm -rf build
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ pids/
cmake-build-debug/
cmake-build-release/
.vscode/
.ccache/
1 change: 1 addition & 0 deletions ci/ccache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max_size = 1.0G
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

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
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
7 changes: 1 addition & 6 deletions ci/scripts/build-and-test-gcc.sh → ci/scripts/cmake-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

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
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

0 comments on commit aa29907

Please sign in to comment.