Build against micro and examples on pull requests (#1724)
* Build against micro and examples on pull requests
This commit is contained in:
parent
87543b2c8a
commit
695cc9d526
6
.github/workflows/micro-examples.yml
vendored
6
.github/workflows/micro-examples.yml
vendored
@ -1,8 +1,8 @@
|
|||||||
name: Build all github.com/micro/examples
|
name: Build all github.com/micro/examples
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'release-**'
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -29,6 +29,6 @@ jobs:
|
|||||||
path: 'examples'
|
path: 'examples'
|
||||||
|
|
||||||
- name: Build all
|
- name: Build all
|
||||||
run: $GITHUB_WORKSPACE/go-micro/.github/workflows/scripts/build-all-examples.sh $GITHUB_SHA
|
run: $GITHUB_WORKSPACE/go-micro/.github/workflows/scripts/build-all-examples.sh ${{ github.event.pull_request.head.sha }}
|
||||||
working-directory: examples
|
working-directory: examples
|
||||||
|
|
8
.github/workflows/micro-main.yml
vendored
8
.github/workflows/micro-main.yml
vendored
@ -1,8 +1,8 @@
|
|||||||
name: Build and test micro
|
name: Build and test micro
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'release-**'
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.13
|
- name: Set up Go 1.13
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.13
|
go-version: 1.13
|
||||||
id: go
|
id: go
|
||||||
@ -29,6 +29,6 @@ jobs:
|
|||||||
path: 'micro'
|
path: 'micro'
|
||||||
|
|
||||||
- name: Build all
|
- name: Build all
|
||||||
run: $GITHUB_WORKSPACE/go-micro/.github/workflows/scripts/build-micro.sh $GITHUB_SHA
|
run: $GITHUB_WORKSPACE/go-micro/.github/workflows/scripts/build-micro.sh ${{ github.event.pull_request.head.sha }}
|
||||||
working-directory: micro
|
working-directory: micro
|
||||||
|
|
9
.github/workflows/scripts/build-micro.sh
vendored
9
.github/workflows/scripts/build-micro.sh
vendored
@ -4,11 +4,16 @@
|
|||||||
failed=0
|
failed=0
|
||||||
go mod edit -replace github.com/micro/go-micro/v2=github.com/micro/go-micro/v2@$1
|
go mod edit -replace github.com/micro/go-micro/v2=github.com/micro/go-micro/v2@$1
|
||||||
# basic test, build the binary
|
# basic test, build the binary
|
||||||
go build
|
go install
|
||||||
failed=$?
|
failed=$?
|
||||||
if [ $failed -gt 0 ]; then
|
if [ $failed -gt 0 ]; then
|
||||||
exit $failed
|
exit $failed
|
||||||
fi
|
fi
|
||||||
# unit tests
|
# unit tests
|
||||||
IN_TRAVIS_CI=yes go test -v ./...
|
IN_TRAVIS_CI=yes go test -v ./...
|
||||||
# TODO integration tests
|
|
||||||
|
./scripts/test-docker.sh
|
||||||
|
# Generate keys for JWT tests
|
||||||
|
ssh-keygen -f /tmp/sshkey -m pkcs8 -q -N ""
|
||||||
|
ssh-keygen -f /tmp/sshkey -e -m pkcs8 > /tmp/sshkey.pub
|
||||||
|
go clean -testcache && IN_TRAVIS_CI=yes go test --tags=integration -v ./test
|
Loading…
x
Reference in New Issue
Block a user