diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml new file mode 100644 index 0000000000..60f3e8b422 --- /dev/null +++ b/.github/workflows/ci-workflow.yml @@ -0,0 +1,46 @@ +name: Continuous Integration +on: + push: + branches: + - ghworkflow + pull_request: + branches: + - master + +jobs: + build_and_test: + name: go ${{ matrix.go_version }} - pb-${{ matrix.protobuf_version }} + runs-on: ubuntu-latest + strategy: + matrix: + go_version: [1.12.x, 1.11.x] + protobuf_version: [3.7.1, 3.0.2, 2.6.1] + fail-fast: false + steps: + - name: Checkout branch + uses: actions/checkout@v1 + with: + path: gopath/src/github.com/gogo/protobuf + fetch-depth: 5 + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go_version }} + + - name: Setup protoc + env: + PROTOBUF_VERSION: ${{ matrix.protobuf_version }} + run: ./install-protobuf.sh + + - name: Protoc version + run: PATH=$HOME/bin:$PATH protoc --version + - name: env + run: env && go env && pwd + + - name: Build server all + run: GOPATH=/home/runner/work/protobuf/gopath GOBIN=$GOPATH/bin PATH=$HOME/bin:$GOBIN:$PATH make buildserverall + + - name: Diff check + if: matrix.protobuf_version == '3.7.1' && matrix.go_version == '1.12.x' + run: (! git status --porcelain | read || (git status; git diff; exit 1)) \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f81e7ba29d..d157b3ffd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ env: - PROTOBUF_VERSION=3.9.1 before_install: - - ./install-protobuf.sh + - HOME=/home/travis ./install-protobuf.sh - PATH=/home/travis/bin:$PATH protoc --version script: diff --git a/install-protobuf.sh b/install-protobuf.sh index f42fc9e631..9017863540 100755 --- a/install-protobuf.sh +++ b/install-protobuf.sh @@ -7,7 +7,7 @@ die() { exit 1 } -cd /home/travis +cd ${HOME} case "$PROTOBUF_VERSION" in 2*) @@ -15,7 +15,7 @@ case "$PROTOBUF_VERSION" in wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz tar xzf $basename.tar.gz cd protobuf-$PROTOBUF_VERSION - ./configure --prefix=/home/travis && make -j2 && make install + ./configure --prefix=${HOME} && make -j2 && make install ;; 3*) basename=protoc-$PROTOBUF_VERSION-linux-x86_64