-
Notifications
You must be signed in to change notification settings - Fork 206
58 lines (54 loc) · 1.64 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: ci
on:
push:
branches: [ master, qa ]
pull_request:
branches: [ master, qa ]
permissions:
contents: read
jobs:
test-gomod:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ['1.19.x', '1.20.x', '1.21.x', '1.22.x']
steps:
- name: Update base image, intall Python2 and Python3
run: |
sudo apt-get update
sudo apt-get install -y python2
sudo apt-get install -y python3
export CLOUDSDK_PYTHON="python3"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
- name: Cache go modules
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.go-version }}-go-
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Install
env:
GO111MODULE: on
run: |
go get .
gcloud components install app-engine-python app-engine-go cloud-datastore-emulator app-engine-python-extras --quiet
- name: Test gomod
env:
GO111MODULE: on
run: |
export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py)
export CLOUDSDK_PYTHON="python3"
go test -v -cover -race google.golang.org/appengine/...
# TestAPICallAllocations doesn't run under race detector.
go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations