name: Tests on: [push, pull_request] jobs: test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: go: [1.12.17, 1.15.15] target: - linux-amd64-fmt - linux-amd64-integration-1-cpu - linux-amd64-integration-2-cpu - linux-amd64-integration-4-cpu - linux-amd64-functional - linux-amd64-unit - all-build - linux-amd64-grpcproxy - linux-386-unit exclude: - go: 1.12.17 target: linux-amd64-grpcproxy - go: 1.12.17 target: linux-386-unit - go: 1.15.15 target: linux-amd64-integration-1-cpu - go: 1.15.15 target: linux-amd64-integration-2-cpu - go: 1.12.17 target: linux-amd64-unit - go: 1.15.15 target: linux-amd64-coverage - go: 1.12.17 target: linux-amd64-fmt - go: 1.15.15 target: linux-386-unit steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }} - run: date - env: TARGET: ${{ matrix.target }} GO_VERSION: ${{ matrix.go }} run: | RACE='true'; if [[ ${GO_VERSION} == 1.15.15 ]]; then echo 'setting race off'; RACE='false'; fi echo "${TARGET}" case "${TARGET}" in linux-amd64-fmt) GOARCH=amd64 PASSES='fmt bom dep' ./test ;; linux-amd64-integration-1-cpu) GOARCH=amd64 CPU=1 PASSES='integration' RACE="${RACE}" ./test ;; linux-amd64-integration-2-cpu) GOARCH=amd64 CPU=2 PASSES='integration' RACE="${RACE}" ./test ;; linux-amd64-integration-4-cpu) GOARCH=amd64 CPU=4 PASSES='integration' RACE="${RACE}" ./test ;; linux-amd64-functional) ./build && GOARCH=amd64 PASSES='functional' RACE="${RACE}" ./test ;; linux-amd64-unit) GOARCH=amd64 PASSES='unit' RACE="${RACE}" ./test ;; all-build) GOARCH=amd64 PASSES='build' ./test GOARCH=386 PASSES='build' ./test GO_BUILD_FLAGS='-v' GOOS=darwin GOARCH=amd64 ./build GO_BUILD_FLAGS='-v' GOOS=windows GOARCH=amd64 ./build GO_BUILD_FLAGS='-v' GOARCH=arm ./build GO_BUILD_FLAGS='-v' GOARCH=arm64 ./build GO_BUILD_FLAGS='-v' GOARCH=ppc64le ./build GO_BUILD_FLAGS='-v' GOARCH=s390x ./build ;; linux-amd64-grpcproxy) PASSES='build grpcproxy' CPU='4' ./test 2>&1 | tee test.log ! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log ;; linux-386-unit) GOARCH=386 PASSES='unit' ./test ;; *) echo "Failed to find target" exit 1 ;; esac