Skip to content

Commit 69adf3e

Browse files
authored
Ghworkflow (#632)
* 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
1 parent 8a5ed79 commit 69adf3e

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.github/workflows/ci-workflow.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- ghworkflow
6+
pull_request:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build_and_test:
12+
name: go ${{ matrix.go_version }} - pb-${{ matrix.protobuf_version }}
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
go_version: [1.12.x, 1.11.x]
17+
protobuf_version: [3.7.1, 3.0.2, 2.6.1]
18+
fail-fast: false
19+
steps:
20+
- name: Checkout branch
21+
uses: actions/checkout@v1
22+
with:
23+
path: gopath/src/github.com/gogo/protobuf
24+
fetch-depth: 5
25+
26+
- name: Setup go
27+
uses: actions/setup-go@v1
28+
with:
29+
go-version: ${{ matrix.go_version }}
30+
31+
- name: Setup protoc
32+
env:
33+
PROTOBUF_VERSION: ${{ matrix.protobuf_version }}
34+
run: ./install-protobuf.sh
35+
36+
- name: Protoc version
37+
run: PATH=$HOME/bin:$PATH protoc --version
38+
- name: env
39+
run: env && go env && pwd
40+
41+
- name: Build server all
42+
run: GOPATH=/home/runner/work/protobuf/gopath GOBIN=$GOPATH/bin PATH=$HOME/bin:$GOBIN:$PATH make buildserverall
43+
44+
- name: Diff check
45+
if: matrix.protobuf_version == '3.7.1' && matrix.go_version == '1.12.x'
46+
run: (! git status --porcelain | read || (git status; git diff; exit 1))

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
- PROTOBUF_VERSION=3.9.1
88

99
before_install:
10-
- ./install-protobuf.sh
10+
- HOME=/home/travis ./install-protobuf.sh
1111
- PATH=/home/travis/bin:$PATH protoc --version
1212

1313
script:

install-protobuf.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ die() {
77
exit 1
88
}
99

10-
cd /home/travis
10+
cd ${HOME}
1111

1212
case "$PROTOBUF_VERSION" in
1313
2*)
1414
basename=protobuf-$PROTOBUF_VERSION
1515
wget https://github.com/google/protobuf/releases/download/v$PROTOBUF_VERSION/$basename.tar.gz
1616
tar xzf $basename.tar.gz
1717
cd protobuf-$PROTOBUF_VERSION
18-
./configure --prefix=/home/travis && make -j2 && make install
18+
./configure --prefix=${HOME} && make -j2 && make install
1919
;;
2020
3*)
2121
basename=protoc-$PROTOBUF_VERSION-linux-x86_64

0 commit comments

Comments
 (0)