blob: b6277ea3065f31d3f22d6ef3e8647c1e93503576 [file] [log] [blame]
name: Testing
# Trigger on pushes, PRs (excluding documentation changes), and nightly.
on:
push:
pull_request:
schedule:
- cron: 0 0 * * * # daily at 00:00
# Always force the use of Go modules
env:
GO111MODULE: on
jobs:
# Check generated protos match their source repos (optional for PRs).
vet-proto:
runs-on: ubuntu-latest
steps:
# Setup the environment.
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Checkout repo
uses: actions/checkout@v2
# Run the vet checks.
- name: vet
run: ./vet.sh -install && ./vet.sh
# Run the main gRPC-Go tests.
tests:
# Proto checks are run in the above job.
env:
VET_SKIP_PROTO: 1
runs-on: ubuntu-latest
strategy:
matrix:
include:
- type: vet+tests
goversion: 1.16
- type: tests
goversion: 1.16
testflags: -race
- type: tests
goversion: 1.16
grpcenv: GRPC_GO_RETRY=on
- type: extras
goversion: 1.16
- type: tests
goversion: 1.16
goarch: 386
- type: tests
goversion: 1.16
goarch: arm64
- type: tests
goversion: 1.15
- type: tests
goversion: 1.14
- type: tests # Keep until interop tests no longer require Go1.11
goversion: 1.11
steps:
# Setup the environment.
- name: Setup GOARCH
if: matrix.goarch != ''
run: echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
- name: Setup qemu emulator
if: matrix.goarch == 'arm64'
# setup qemu-user-static emulator and register it with binfmt_misc so that aarch64 binaries
# are automatically executed using qemu.
run: docker run --rm --privileged multiarch/qemu-user-static:5.2.0-2 --reset --credential yes --persistent yes
- name: Setup GRPC environment
if: matrix.grpcenv != ''
run: echo "${{ matrix.grpcenv }}" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.goversion }}
- name: Checkout repo
uses: actions/checkout@v2
# Only run vet for 'vet' runs.
- name: Run vet.sh
if: startsWith(matrix.type, 'vet')
run: ./vet.sh -install && ./vet.sh
# Main tests run for everything except when testing "extras"
# (where we run a reduced set of tests).
- name: Run tests
if: contains(matrix.type, 'tests')
run: |
go version
go test ${{ matrix.testflags }} -cpu 1,4 -timeout 7m google.golang.org/grpc/...
# Non-core gRPC tests (examples, interop, etc)
- name: Run extras tests
if: matrix.type == 'extras'
run: |
go version
examples/examples_test.sh
security/advancedtls/examples/examples_test.sh
interop/interop_test.sh
cd ${GITHUB_WORKSPACE}/security/advancedtls && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/advancedtls/...
cd ${GITHUB_WORKSPACE}/security/authorization && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/authorization/...