|
| 1 | +name: ci-v2 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master, qa ] |
| 6 | + pull_request: |
| 7 | + branches: [ master, qa ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test-gomod-v2: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x'] |
| 15 | + env: |
| 16 | + working-directory: ./v2 |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Set up Go |
| 20 | + uses: actions/setup-go@v2 |
| 21 | + with: |
| 22 | + go-version: ${{ matrix.go-version }} |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v2 |
| 25 | + - name: Cache go modules |
| 26 | + uses: actions/cache@v2 |
| 27 | + with: |
| 28 | + path: | |
| 29 | + ~/.cache/go-build |
| 30 | + ~/go/pkg/mod |
| 31 | + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-${{ matrix.go-version }}-go- |
| 34 | + - name: Set up Cloud SDK |
| 35 | + uses: google-github-actions/setup-gcloud@master |
| 36 | + - name: Install |
| 37 | + working-directory: ${{env.working-directory}} |
| 38 | + env: |
| 39 | + GO111MODULE: on |
| 40 | + run: | |
| 41 | + go get . |
| 42 | + gcloud components install app-engine-python app-engine-go cloud-datastore-emulator --quiet |
| 43 | + - name: Test gomod v2 |
| 44 | + env: |
| 45 | + GO111MODULE: on |
| 46 | + working-directory: ${{env.working-directory}} |
| 47 | + run: | |
| 48 | + export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) |
| 49 | + go test -v -cover -race google.golang.org/appengine/v2/... |
| 50 | + # TestAPICallAllocations doesn't run under race detector. |
| 51 | + go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations |
| 52 | + |
| 53 | + test-gopath-v2: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + strategy: |
| 56 | + matrix: |
| 57 | + # GOPATH is deprecated in go 1.13. |
| 58 | + go-version: [ '1.11.x', '1.12.x'] |
| 59 | + env: |
| 60 | + working-directory: ./v2 |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Set up Go |
| 64 | + uses: actions/setup-go@v2 |
| 65 | + with: |
| 66 | + go-version: ${{ matrix.go-version }} |
| 67 | + - name: Checkout |
| 68 | + uses: actions/checkout@v2 |
| 69 | + - name: Cache go modules |
| 70 | + uses: actions/cache@v2 |
| 71 | + with: |
| 72 | + path: | |
| 73 | + ~/.cache/go-build |
| 74 | + ~/go/pkg/mod |
| 75 | + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} |
| 76 | + restore-keys: | |
| 77 | + ${{ runner.os }}-${{ matrix.go-version }}-go- |
| 78 | + - name: Set up Cloud SDK |
| 79 | + uses: google-github-actions/setup-gcloud@master |
| 80 | + - name: Install |
| 81 | + working-directory: ${{env.working-directory}} |
| 82 | + env: |
| 83 | + GO111MODULE: off |
| 84 | + run: | |
| 85 | + go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v appengine) |
| 86 | + go get -u google.golang.org/appengine/v2 |
| 87 | + gcloud components install app-engine-python app-engine-go cloud-datastore-emulator --quiet |
| 88 | + - name: Test gopath v2 |
| 89 | + working-directory: ${{env.working-directory}} |
| 90 | + run: | |
| 91 | + export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) |
| 92 | + go test -v -cover -race google.golang.org/appengine/v2/... |
| 93 | + # TestAPICallAllocations doesn't run under race detector. |
| 94 | + go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations |
0 commit comments