|
| 1 | +name: Testing |
| 2 | + |
| 3 | +# Trigger on pushes, PRs (excluding documentation changes), and nightly. |
| 4 | +on: |
| 5 | + push: |
| 6 | + pull_request: |
| 7 | + paths-ignore: |
| 8 | + - 'Documentation/**' |
| 9 | + - 'version.go' |
| 10 | + schedule: |
| 11 | + - cron: 0 0 * * * # daily at 00:00 |
| 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 | + steps: |
| 22 | + # Setup the environment. |
| 23 | + - name: Setup Go |
| 24 | + uses: actions/setup-go@v2 |
| 25 | + with: |
| 26 | + go-version: 1.14 |
| 27 | + - name: Checkout repo |
| 28 | + uses: actions/checkout@v2 |
| 29 | + |
| 30 | + # Run the vet checks. |
| 31 | + - name: vet |
| 32 | + run: ./vet.sh -install && ./vet.sh |
| 33 | + |
| 34 | + # Run the main gRPC-Go tests. |
| 35 | + tests: |
| 36 | + # Proto checks are run in the above job. |
| 37 | + env: |
| 38 | + VET_SKIP_PROTO: 1 |
| 39 | + runs-on: ubuntu-latest |
| 40 | + strategy: |
| 41 | + matrix: |
| 42 | + include: |
| 43 | + - type: vet |
| 44 | + goversion: 1.14 |
| 45 | + - type: race |
| 46 | + goversion: 1.14 |
| 47 | + - type: 386 |
| 48 | + goversion: 1.14 |
| 49 | + - type: retry |
| 50 | + goversion: 1.14 |
| 51 | + - type: extras |
| 52 | + goversion: 1.14 |
| 53 | + - type: tests |
| 54 | + goversion: 1.13 |
| 55 | + - type: tests |
| 56 | + goversion: 1.12 |
| 57 | + - type: tests |
| 58 | + goversion: 1.11 # Keep until interop tests no longer require Go1.11 |
| 59 | + |
| 60 | + steps: |
| 61 | + # Setup the environment. |
| 62 | + - name: Setup GOARCH=386 |
| 63 | + if: ${{ matrix.type == '386' }} |
| 64 | + run: echo "GOARCH=386" >> $GITHUB_ENV |
| 65 | + - name: Setup RETRY |
| 66 | + if: ${{ matrix.type == 'retry' }} |
| 67 | + run: echo "GRPC_GO_RETRY=on" >> $GITHUB_ENV |
| 68 | + - name: Setup Go |
| 69 | + uses: actions/setup-go@v2 |
| 70 | + with: |
| 71 | + go-version: ${{ matrix.goversion }} |
| 72 | + - name: Checkout repo |
| 73 | + uses: actions/checkout@v2 |
| 74 | + |
| 75 | + # Only run vet for 'vet' runs. |
| 76 | + - name: Run vet.sh |
| 77 | + if: ${{ matrix.type == 'vet' }} |
| 78 | + run: ./vet.sh -install && ./vet.sh |
| 79 | + |
| 80 | + # Main tests run for everything except when testing "extras" and the race detector. |
| 81 | + - name: Run tests |
| 82 | + if: ${{ matrix.type != 'extras' && matrix.type != 'race' }} |
| 83 | + run: make test |
| 84 | + |
| 85 | + # Race detector tests |
| 86 | + - name: Run test race |
| 87 | + if: ${{ matrix.TYPE == 'race' }} |
| 88 | + run: make testrace |
| 89 | + |
| 90 | + # Non-core gRPC tests (examples, interop, etc) |
| 91 | + - name: Run extras tests |
| 92 | + if: ${{ matrix.TYPE == 'extras' }} |
| 93 | + run: | |
| 94 | + examples/examples_test.sh |
| 95 | + security/advancedtls/examples/examples_test.sh |
| 96 | + interop/interop_test.sh |
| 97 | + make testsubmodule |
0 commit comments