diff --git a/.github/workflows/micro-examples.yml b/.github/workflows/micro-examples.yml index 95186c8f..ebd91ef8 100644 --- a/.github/workflows/micro-examples.yml +++ b/.github/workflows/micro-examples.yml @@ -1,8 +1,8 @@ name: Build all github.com/micro/examples on: - push: + pull_request: branches: - - 'release-**' + - master jobs: @@ -29,6 +29,6 @@ jobs: path: 'examples' - 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 \ No newline at end of file diff --git a/.github/workflows/micro-main.yml b/.github/workflows/micro-main.yml index f74f1c79..311dc431 100644 --- a/.github/workflows/micro-main.yml +++ b/.github/workflows/micro-main.yml @@ -1,8 +1,8 @@ name: Build and test micro on: - push: + pull_request: branches: - - 'release-**' + - master jobs: @@ -12,7 +12,7 @@ jobs: steps: - name: Set up Go 1.13 - uses: actions/setup-go@v1 + uses: actions/setup-go@v2 with: go-version: 1.13 id: go @@ -29,6 +29,6 @@ jobs: path: 'micro' - 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 \ No newline at end of file diff --git a/.github/workflows/scripts/build-micro.sh b/.github/workflows/scripts/build-micro.sh index 38b9b999..d5563f8e 100755 --- a/.github/workflows/scripts/build-micro.sh +++ b/.github/workflows/scripts/build-micro.sh @@ -4,11 +4,16 @@ failed=0 go mod edit -replace github.com/micro/go-micro/v2=github.com/micro/go-micro/v2@$1 # basic test, build the binary -go build +go install failed=$? if [ $failed -gt 0 ]; then exit $failed fi # unit tests IN_TRAVIS_CI=yes go test -v ./... -# TODO integration tests \ No newline at end of file + +./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 \ No newline at end of file