google.golang.org/grpc@v1.62.1/.github/workflows/testing.yml (about) 1 name: Testing 2 3 # Trigger on pushes, PRs (excluding documentation changes), and nightly. 4 on: 5 push: 6 pull_request: 7 schedule: 8 - cron: 0 0 * * * # daily at 00:00 9 10 permissions: 11 contents: read 12 13 # Always force the use of Go modules 14 env: 15 GO111MODULE: on 16 17 jobs: 18 # Check generated protos match their source repos (optional for PRs). 19 vet-proto: 20 runs-on: ubuntu-latest 21 timeout-minutes: 20 22 env: 23 VET_ONLY_PROTO: 1 24 steps: 25 # Setup the environment. 26 - name: Setup Go 27 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 28 with: 29 go-version: '1.21' 30 - name: Checkout repo 31 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 32 33 # Run the vet checks. 34 - name: vet 35 run: ./vet.sh -install && ./vet.sh 36 37 # Run the main gRPC-Go tests. 38 tests: 39 # Proto checks are run in the above job. 40 env: 41 VET_SKIP_PROTO: 1 42 runs-on: ubuntu-latest 43 timeout-minutes: 20 44 strategy: 45 fail-fast: false 46 matrix: 47 include: 48 - type: vet 49 goversion: '1.21' 50 51 - type: tests 52 goversion: '1.21' 53 54 - type: tests 55 goversion: '1.21' 56 testflags: -race 57 58 - type: tests 59 goversion: '1.21' 60 goarch: 386 61 62 - type: tests 63 goversion: '1.21' 64 goarch: arm64 65 66 - type: tests 67 goversion: '1.20' 68 69 - type: tests 70 goversion: '1.19' 71 72 - type: extras 73 goversion: '1.21' 74 75 steps: 76 # Setup the environment. 77 - name: Setup GOARCH 78 if: matrix.goarch != '' 79 run: echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV 80 81 - name: Setup qemu emulator 82 if: matrix.goarch == 'arm64' 83 # setup qemu-user-static emulator and register it with binfmt_misc so that aarch64 binaries 84 # are automatically executed using qemu. 85 run: docker run --rm --privileged multiarch/qemu-user-static:5.2.0-2 --reset --credential yes --persistent yes 86 87 - name: Setup GRPC environment 88 if: matrix.grpcenv != '' 89 run: echo "${{ matrix.grpcenv }}" >> $GITHUB_ENV 90 91 - name: Setup Go 92 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 93 with: 94 go-version: ${{ matrix.goversion }} 95 96 - name: Checkout repo 97 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 98 99 # Only run vet for 'vet' runs. 100 - name: Run vet.sh 101 if: matrix.type == 'vet' 102 run: ./vet.sh -install && ./vet.sh 103 104 # Main tests run for everything except when testing "extras" 105 # (where we run a reduced set of tests). 106 - name: Run tests 107 if: matrix.type == 'tests' 108 run: | 109 go version 110 go test ${{ matrix.testflags }} -cpu 1,4 -timeout 7m google.golang.org/grpc/... 111 cd "${GITHUB_WORKSPACE}" 112 for MOD_FILE in $(find . -name 'go.mod' | grep -Ev '^\./go\.mod'); do 113 pushd "$(dirname ${MOD_FILE})" 114 go test ${{ matrix.testflags }} -cpu 1,4 -timeout 2m ./... 115 popd 116 done 117 118 # Non-core gRPC tests (examples, interop, etc) 119 - name: Run extras tests 120 if: matrix.type == 'extras' 121 run: | 122 export TERM=${TERM:-xterm} 123 go version 124 echo -e "\n-- Running Examples --" 125 examples/examples_test.sh 126 echo -e "\n-- Running AdvancedTLS Examples --" 127 security/advancedtls/examples/examples_test.sh 128 echo -e "\n-- Running Interop Test --" 129 interop/interop_test.sh 130 echo -e "\n-- Running xDS E2E Test --" 131 xds/internal/test/e2e/run.sh