Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
chore: migrate ci from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
neverchanje committed Nov 4, 2020
1 parent 1863cf9 commit 674c417
Show file tree
Hide file tree
Showing 6 changed files with 514 additions and 97 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Developer Notes:
#
# This config is for github actions. Before merging your changes of this file,
# it's recommended to create a PR against the ci-test branch to test if it works
# as expected.

name: pull_request

on:
# run on each pull request
pull_request:
types: [ synchronize, reopened, labeled ]
branches:
- master
- 'v[0-9]+.*' # release branch
- ci-test # testing branch for github action

defaults:
run:
shell: bash

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
container:
image: apachepegasus/clang-format-3.9
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: clang-format
run: ./scripts/linux/run-clang-format.py --clang-format-executable=clang-format-3.9 -r src include

test:
name: Test
needs: lint
runs-on: self-hosted
if: contains(github.event.pull_request.labels.*.name, 'ready-for-testing')
container:
image: apachepegasus/ci-env
env:
CCACHE_DIR: /tmp/ccache/pegasus
CCACHE_MAXSIZE: 10G
volumes:
# Place ccache compilation intermediate results in host memory, that's shared among containers.
- /tmp/ccache/pegasus:/tmp/ccache/pegasus
# Read docs at https://docs.docker.com/storage/tmpfs/ for more details of using tmpfs in docker.
options: --mount type=tmpfs,destination=/tmp/pegasus,tmpfs-size=10737418240 --cap-add=SYS_PTRACE
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Unpack prebuilt third-parties
if: contains(github.event.pull_request.labels.*.name, 'thirdparty-modified') == false
run: unzip /root/pegasus-thirdparty-output.zip -d ./thirdparty
- name: Rebuild third-parties
if: contains(github.event.pull_request.labels.*.name, 'thirdparty-modified')
working-directory: thirdparty
run: |
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/
cmake --build build/ -j $(($(nproc)/2+1))
- name: Compilation
run: ./run.sh build -c --skip_thirdparty
- name: Unit Testing
run: ./run.sh test --skip_thirdparty
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

43 changes: 0 additions & 43 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,46 +207,6 @@ function run_build()
DISABLE_GPERF="$DISABLE_GPERF" $scripts_dir/build.sh
}

#####################
## install
#####################
function usage_install()
{
echo "Options for subcommand 'install':"
echo " -h|--help print the help info"
echo " -d|--install_dir <dir>"
echo " specify the install directory,"
echo " if not set, then default is './install'"
}
function run_install()
{
INSTALL_DIR=$DSN_ROOT
if [ ! -d $INSTALL_DIR ]; then
INSTALL_DIR=`pwd`/install
fi
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_install
exit 0
;;
-d|--install_dir)
INSTALL_DIR="$2"
shift
;;
*)
echo "ERROR: unknown option \"$key\""
echo
usage_install
exit 1
;;
esac
shift
done
INSTALL_DIR="$INSTALL_DIR" $scripts_dir/install.sh
}

#####################
## start_zk
#####################
Expand Down Expand Up @@ -386,9 +346,6 @@ case $cmd in
shift
ONLY_BUILD=YES
run_build $* ;;
install)
shift
run_install $* ;;
test)
shift
ONLY_BUILD=NO
Expand Down
Loading

0 comments on commit 674c417

Please sign in to comment.