Skip to content

Commit

Permalink
Ghworkflow (#632)
Browse files Browse the repository at this point in the history
* add test ci-workflow

* ci-workflow. update install protobuf script to use HOME var as configure prefix

* workflow config update

* github/actions. add trigger for pull requests on master
  • Loading branch information
jmarais committed Oct 6, 2019
1 parent 8a5ed79 commit 69adf3e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .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))
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions install-protobuf.sh
Expand Up @@ -7,15 +7,15 @@ die() {
exit 1
}

cd /home/travis
cd ${HOME}

case "$PROTOBUF_VERSION" in
2*)
basename=protobuf-$PROTOBUF_VERSION
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
Expand Down

0 comments on commit 69adf3e

Please sign in to comment.