Skip to content

Commit

Permalink
Add version info to action job and build docker images for release br…
Browse files Browse the repository at this point in the history
…anches (vesoft-inc#1654)

* Add compiler version for job name

* Run docker and package workflow for release branchs

* Build release type for PR workflow

Co-authored-by: dutor <440396+dutor@users.noreply.github.com>
  • Loading branch information
2 people authored and jude-zhu committed Jan 19, 2020
1 parent 2a49d7a commit 7d0a12a
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 29 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- ubuntu1604
- ubuntu1804
compiler:
- gcc
- clang
- gcc-7.5
- clang-8
exclude:
- tag: centos6
compiler: clang
compiler: clang-8
- tag: centos7
compiler: clang
compiler: clang-8
- tag: ubuntu1604
compiler: clang
compiler: clang-8
container:
image: vesoft/nebula-dev:${{ matrix.tag }}
steps:
Expand All @@ -37,14 +37,29 @@ jobs:
fetch-depth: 1
- name: Prepare environment
run: mkdir -p build
- name: CMake with gcc
if: matrix.compiler == 'gcc'
run: cd build && cmake ..
- 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 -DNEBULA_CLANG_USE_GCC_TOOLCHAIN=/opt/vesoft/toolset/gcc/7.5.0 ..
- name: CMake with gcc-7.5
if: matrix.compiler == 'gcc-7.5'
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: CMake with clang-8
if: matrix.compiler == 'clang-8'
run: |
cd build
cmake \
-DCMAKE_CXX_COMPILER=clang++-8 \
-DCMAKE_C_COMPILER=clang-8 \
-DENABLE_ASAN=on \
-DNEBULA_CLANG_USE_GCC_TOOLCHAIN=/opt/vesoft/toolset/gcc/7.5.0 \
..
- name: Make
run: cd build && make -j $(nproc)
- name: CTest with single thread
timeout-minutes: 40
run: cd build && ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ASAN_OPTIONS=fast_unwind_on_malloc=0 ctest --timeout 300 --output-on-failure
run: |
cd build
ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \
ASAN_OPTIONS=fast_unwind_on_malloc=0 \
ctest \
--timeout 300 \
--output-on-failure
16 changes: 14 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: docker
on:
schedule:
- cron: '0 18 * * *'
push:
branches:
- 'v[0-9]+*'
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
docker:
Expand All @@ -24,9 +30,15 @@ jobs:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: build nightly image
- name: Compute tag
id: tag
run: |
[[ "${{ github.event_name }}" == "push" ]] && \
echo "::set-output name=tag::${{ github.ref }}" || \
echo "::set-output name=tag::nightly"
- name: Build image
env:
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/nebula-${{ matrix.service }}:nightly
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/nebula-${{ matrix.service }}:${{ steps.tag.outputs.tag }}
run: |
docker build -t ${IMAGE_NAME} -f docker/Dockerfile.${{ matrix.service }} .
docker push ${IMAGE_NAME}
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: package
on:
schedule:
- cron: '0 18 * * *'
push:
branches:
- 'v[0-9]+*'
paths-ignore:
- 'docs/**'
- '**.md'

jobs:
package:
Expand All @@ -19,11 +25,16 @@ jobs:
image: vesoft/nebula-dev:${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: package
- name: Package
run: ./package/package.sh
shell: bash
- name: Upload nightly artifacts
uses: actions/upload-artifact@v1
- name: Compute version
id: version
run: |
[[ "${{ github.event_name }}" == "push" ]] && \
echo "::set-output name=version::${{ github.ref }}" || \
echo "::set-output name=version::nightly"
- uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}-nightly
name: ${{ matrix.os }}-${{ steps.version.outputs.version }}
path: build/cpack_output
45 changes: 34 additions & 11 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [synchronize, reopened, labeled]
branches:
- master
- 'v[0-9]+*'

jobs:
lint:
Expand All @@ -30,11 +31,11 @@ jobs:
- centos7
- ubuntu1804
compiler:
- gcc
- clang
- gcc-7.5
- clang-8
exclude:
- tag: centos7
compiler: clang
compiler: clang-8
container:
image: vesoft/nebula-dev:${{ matrix.tag }}
env:
Expand All @@ -53,23 +54,45 @@ jobs:
run: |
[ -f "$CCACHE_DIR/ccache.conf" ] || cp ci/ccache.conf "$CCACHE_DIR"
[ -d build/ ] && rm -rf build/* || mkdir -p build
- name: CMake with gcc
if: matrix.compiler == 'gcc' && steps.ignore_docs.outputs.num_source_files != 0
run: cd build && cmake ..
- name: CMake with clang
if: matrix.compiler == 'clang' && steps.ignore_docs.outputs.num_source_files != 0
run: cd build && cmake -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DENABLE_ASAN=on -DNEBULA_CLANG_USE_GCC_TOOLCHAIN=/opt/vesoft/toolset/gcc/7.5.0 ..
- name: CMake with gcc-7.5
if: matrix.compiler == 'gcc-7.5' && steps.ignore_docs.outputs.num_source_files != 0
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: CMake with clang-8
if: matrix.compiler == 'clang-8' && steps.ignore_docs.outputs.num_source_files != 0
run: |
cd build
cmake \
-DCMAKE_CXX_COMPILER=clang++-8 \
-DCMAKE_C_COMPILER=clang-8 \
-DENABLE_ASAN=on \
-DNEBULA_CLANG_USE_GCC_TOOLCHAIN=/opt/vesoft/toolset/gcc/7.5.0 \
..
- name: Make
if: steps.ignore_docs.outputs.num_source_files != 0
run: cd build && make -j $(nproc)
- name: CTest with multiple threads
if: steps.ignore_docs.outputs.num_source_files != 0
timeout-minutes: 15
run: cd build && ctest -j 6 --timeout 300 --output-on-failure --rerun-failed
run: |
cd build
ctest \
-j 6 \
--timeout 300 \
--output-on-failure \
--rerun-failed
- name: CTest with single thread
if: failure() && steps.ignore_docs.outputs.num_source_files != 0
timeout-minutes: 30
run: cd build && ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ASAN_OPTIONS=fast_unwind_on_malloc=0 ctest --timeout 300 --output-on-failure --rerun-failed
run: |
cd build
ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer \
ASAN_OPTIONS=fast_unwind_on_malloc=0 \
ctest \
--timeout 300 \
--output-on-failure \
--rerun-failed
- name: Cleanup
if: always()
run: rm -rf build

0 comments on commit 7d0a12a

Please sign in to comment.