google.golang.org/grpc@v1.72.2/.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      steps:
    23        - name: Checkout repo
    24          uses: actions/checkout@v4
    25  
    26        # Setup the environment.
    27        - name: Setup Go
    28          uses: actions/setup-go@v5
    29          with:
    30            go-version: '1.24'
    31            cache-dependency-path: "**/go.sum"
    32  
    33        # Run the vet-proto checks.
    34        - name: vet-proto
    35          run: ./scripts/vet-proto.sh -install && ./scripts/vet-proto.sh
    36  
    37    # Run the main gRPC-Go tests.
    38    tests:
    39      runs-on: ubuntu-latest
    40      timeout-minutes: 20
    41      strategy:
    42        fail-fast: false
    43        matrix:
    44          include:
    45            - type: vet
    46              goversion: '1.23'
    47  
    48            - type: extras
    49              goversion: '1.24'
    50  
    51            - type: tests
    52              goversion: '1.24'
    53  
    54            - type: tests
    55              goversion: '1.24'
    56              testflags: -race
    57  
    58            - type: tests
    59              goversion: '1.24'
    60              goarch: 386
    61  
    62            - type: tests
    63              goversion: '1.24'
    64              goarch: arm64
    65  
    66            - type: tests
    67              goversion: '1.23'
    68  
    69            - type: tests
    70              goversion: '1.24'
    71              testflags: -race
    72              grpcenv: 'GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=false'
    73  
    74      steps:
    75        # Setup the environment.
    76        - name: Setup GOARCH
    77          if: matrix.goarch != ''
    78          run: echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
    79  
    80        - name: Setup qemu emulator
    81          if: matrix.goarch == 'arm64'
    82          # setup qemu-user-static emulator and register it with binfmt_misc so that aarch64 binaries
    83          # are automatically executed using qemu.
    84          run: docker run --rm --privileged multiarch/qemu-user-static:7.2.0-1 --reset --credential yes --persistent yes
    85  
    86        - name: Setup GRPC environment
    87          if: matrix.grpcenv != ''
    88          run: echo "${{ matrix.grpcenv }}" >> $GITHUB_ENV
    89  
    90        - name: Checkout repo
    91          uses: actions/checkout@v4
    92  
    93        - name: Setup Go
    94          uses: actions/setup-go@v5
    95          with:
    96            go-version: ${{ matrix.goversion }}
    97            cache-dependency-path: "**/*go.sum"
    98  
    99        # Only run vet for 'vet' runs.
   100        - name: Run vet.sh
   101          if: matrix.type == 'vet'
   102          run: ./scripts/vet.sh -install && ./scripts/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 ./...
   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
   132            echo -e "\n-- Running protoc-gen-go-grpc test --"
   133            ./scripts/vet-proto.sh -install
   134            cmd/protoc-gen-go-grpc/protoc-gen-go-grpc_test.sh