blob: 4ee25c624477951a15fab5675a8526505fabb942 [file] [edit]
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.25.x']
steps:
- name: Update base image and install Python3
run: |
sudo apt-get update
sudo apt-get install -y python3
export CLOUDSDK_PYTHON="python3"
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache go modules
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
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@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
- 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