Skip to content

Commit d66d3ad

Browse files
authored
Merge branch 'main' into james/oss-3399-examples-tf-versions
2 parents 7a1e518 + 63b6377 commit d66d3ad

81 files changed

Lines changed: 1305 additions & 1809 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 0 additions & 198 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: GCP Integration Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'modules/gcp/**'
8+
- 'test/gcp/**'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- '.github/workflows/gcp-integration-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'modules/gcp/**'
15+
- 'test/gcp/**'
16+
- 'go.mod'
17+
- 'go.sum'
18+
- '.github/workflows/gcp-integration-tests.yml'
19+
workflow_dispatch:
20+
21+
jobs:
22+
gcp-integration-tests:
23+
name: GCP Integration Tests
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 60
26+
permissions:
27+
contents: read
28+
id-token: write
29+
30+
env:
31+
# GOOGLE_CLOUD_PROJECT is the env var that the GCP provider helper
32+
# (gcp.GetGoogleProjectIDFromEnvVar) actually reads.
33+
GOOGLE_CLOUD_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
34+
# GOOGLE_COMPUTE_ZONE is optional; only used to set the gcloud CLI default zone.
35+
GOOGLE_COMPUTE_ZONE: ${{ vars.GOOGLE_COMPUTE_ZONE }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Install mise
41+
uses: jdx/mise-action@v3
42+
with:
43+
version: 2025.12.10
44+
experimental: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Go module cache
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/go/pkg/mod
53+
~/.cache/go-build
54+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
55+
restore-keys: |
56+
${{ runner.os }}-go-
57+
58+
- name: Download Go modules
59+
run: go mod download
60+
61+
- name: Authenticate to Google Cloud
62+
uses: google-github-actions/auth@v2
63+
with:
64+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER_ID }}
65+
service_account: ${{ secrets.GCP_SA_EMAIL }}
66+
audience: ${{ secrets.GCP_ALLOWED_AUDIENCES }}
67+
68+
- name: Set up gcloud CLI
69+
uses: google-github-actions/setup-gcloud@v2
70+
with:
71+
project_id: ${{ secrets.GCP_PROJECT_ID }}
72+
73+
- name: Configure gcloud defaults
74+
run: |
75+
gcloud --quiet config set project "$GOOGLE_CLOUD_PROJECT"
76+
if [ -n "$GOOGLE_COMPUTE_ZONE" ]; then
77+
gcloud --quiet config set compute/zone "$GOOGLE_COMPUTE_ZONE"
78+
fi
79+
80+
- name: Run GCP integration tests
81+
run: |
82+
mkdir -p /tmp/logs
83+
go test -v -count=1 -timeout 45m -tags gcp ./test/gcp/... 2>&1 | tee /tmp/logs/gcp-integration-tests.log
84+
85+
- name: Upload test logs
86+
if: always()
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: gcp-integration-test-logs
90+
path: /tmp/logs/
91+
retention-days: 14

.github/workflows/gcp-tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: GCP Unit Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'modules/gcp/**'
8+
- 'test/gcp/**'
9+
- 'go.mod'
10+
- 'go.sum'
11+
- '.github/workflows/gcp-tests.yml'
12+
pull_request:
13+
paths:
14+
- 'modules/gcp/**'
15+
- 'test/gcp/**'
16+
- 'go.mod'
17+
- 'go.sum'
18+
- '.github/workflows/gcp-tests.yml'
19+
workflow_dispatch:
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
test:
26+
name: GCP Unit Tests
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 15
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- name: Install mise
34+
uses: jdx/mise-action@v3
35+
with:
36+
version: 2025.12.10
37+
experimental: true
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Go module cache
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
~/go/pkg/mod
46+
~/.cache/go-build
47+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
48+
restore-keys: |
49+
${{ runner.os }}-go-
50+
51+
- name: Download Go modules
52+
run: go mod download
53+
54+
- name: Build GCP module
55+
run: go build ./modules/gcp/...
56+
57+
- name: Compile GCP integration tests
58+
run: go test -tags gcp -c -o /dev/null ./test/gcp/...
59+
60+
- name: Run GCP module tests
61+
run: |
62+
mkdir -p /tmp/logs
63+
go test -v -count=1 -timeout 10m ./modules/gcp/... 2>&1 | tee /tmp/logs/gcp-module-tests.log
64+
65+
- name: Upload test logs
66+
if: always()
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: gcp-unit-test-logs
70+
path: /tmp/logs/
71+
retention-days: 14

.golangci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ linters:
121121
- docs
122122
- _ci
123123
- .github
124-
- .circleci
125124
- third_party$
126125
- builtin$
127126
- examples$
@@ -140,7 +139,6 @@ formatters:
140139
- docs
141140
- _ci
142141
- .github
143-
- .circleci
144142
- third_party$
145143
- builtin$
146144
- examples$

0 commit comments

Comments
 (0)