2020-10-19 02:36:40 +00:00
|
|
|
name: Build and test
|
|
|
|
# TODO: do not trigger action for some document file update
|
|
|
|
|
|
|
|
# This workflow is triggered on pushes or pull request to the repository.
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2020-10-24 03:36:42 +00:00
|
|
|
- 'scripts/**'
|
2020-10-19 02:36:40 +00:00
|
|
|
- 'internal/**'
|
|
|
|
- 'cmd/**'
|
|
|
|
- '.github/workflows/main.yml'
|
|
|
|
- docker-compose.yml
|
|
|
|
- '!**.md'
|
|
|
|
- '!**_test.go'
|
|
|
|
pull_request:
|
|
|
|
# file paths to consider in the event. Optional; defaults to all.
|
|
|
|
paths:
|
2020-10-24 03:36:42 +00:00
|
|
|
- 'scripts/**'
|
2020-10-19 02:36:40 +00:00
|
|
|
- 'internal/**'
|
|
|
|
- 'cmd/**'
|
|
|
|
- '.github/workflows/main.yml'
|
|
|
|
- docker-compose.yml
|
|
|
|
- '!**.md'
|
|
|
|
- '!**_test.go'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ubuntu:
|
2020-10-27 04:01:27 +00:00
|
|
|
name: AMD64 ubuntu-18.04
|
|
|
|
runs-on: ubuntu-18.04
|
2020-10-19 02:36:40 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-10-27 04:01:27 +00:00
|
|
|
- name: Install Dependency
|
|
|
|
run: |
|
|
|
|
./scripts/install_deps.sh
|
|
|
|
go get github.com/golang/protobuf/protoc-gen-go@v1.3.2
|
|
|
|
- name: Cache Core Thirdparty
|
|
|
|
id: cache-core
|
|
|
|
uses: actions/cache@v2
|
2020-10-19 02:36:40 +00:00
|
|
|
with:
|
2020-10-27 04:01:27 +00:00
|
|
|
path: |
|
|
|
|
./internal/core/cmake_build
|
|
|
|
key: ${{ runner.os }}-core-thirdparty
|
|
|
|
- name: Build Cpp
|
2020-10-19 02:36:40 +00:00
|
|
|
run: |
|
2020-10-27 04:01:27 +00:00
|
|
|
./scripts/core_build.sh -u
|
|
|
|
- name: Generat Proto GO File
|
2020-10-19 02:36:40 +00:00
|
|
|
run: |
|
2020-10-27 04:01:27 +00:00
|
|
|
echo `pwd`
|
|
|
|
pwd_dir=`pwd`
|
|
|
|
export PATH=$PATH:$(go env GOPATH)/bin
|
|
|
|
export protoc=${pwd_dir}/internal/core/cmake_build/thirdparty/protobuf/protobuf-build/protoc
|
|
|
|
./scripts/proto_gen_go.sh
|
|
|
|
- name: Build GO
|
|
|
|
run: |
|
|
|
|
go build -o ./cmd/writer/writer ./cmd/writer/writer.go
|
|
|
|
go build -o ./cmd/reader/reader ./cmd/reader/reader.go
|
|
|
|
go build -o ./cmd/master/master ./cmd/master/master.go
|
|
|
|
go build -o ./cmd/proxy/proxy ./cmd/proxy/proxy.go
|
|
|
|
- name: Docker Pull And Run
|
2020-10-19 02:36:40 +00:00
|
|
|
run: |
|
2020-10-27 04:01:27 +00:00
|
|
|
docker-compose up -d
|
|
|
|
- name: Run Unittest
|
2020-10-19 02:36:40 +00:00
|
|
|
run: |
|
2020-10-27 04:01:27 +00:00
|
|
|
./scripts/run_unittest.sh
|