-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (50 loc) · 1.55 KB
/
integration-tests-on-production.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
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
name: Integration tests on production
jobs:
check-env:
outputs:
has-key: ${{ steps.project-id.outputs.defined }}
runs-on: ubuntu-latest
steps:
- id: project-id
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
if: "${{ env.GCP_PROJECT_ID != '' }}"
run: echo "::set-output name=defined::true"
test:
needs: [check-env]
if: needs.check-env.outputs.has-key == 'true'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Setup GCloud
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Run integration tests on production
run: go test -v -timeout 45m ./... -run '^TestIntegration_'
env:
JOB_TYPE: test
SPANNER_TEST_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
SPANNER_TEST_INSTANCE: test-instance
- name: Run samples tests on production
run: cd samples && go test -v -timeout 45m ./... -run '^TestIntegration_'
env:
JOB_TYPE: test
SPANNER_TEST_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
SPANNER_TEST_INSTANCE: samples-instance