Skip to content

Commit a97674b

Browse files
authored
Merge branch 'main' into update-lint-config
2 parents 181a24f + c048882 commit a97674b

83 files changed

Lines changed: 1399 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.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Azure Integration Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'modules/azure/**'
8+
- 'test/azure/**'
9+
- 'examples/azure/**'
10+
- 'go.mod'
11+
- 'go.sum'
12+
- 'mise.toml'
13+
- '.github/workflows/azure-integration-tests.yml'
14+
pull_request:
15+
paths:
16+
- 'modules/azure/**'
17+
- 'test/azure/**'
18+
- 'examples/azure/**'
19+
- 'go.mod'
20+
- 'go.sum'
21+
- 'mise.toml'
22+
- '.github/workflows/azure-integration-tests.yml'
23+
workflow_dispatch:
24+
25+
concurrency:
26+
group: azure-integration-tests-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
azure-integration-tests:
31+
name: Azure Integration Tests
32+
if: >-
33+
github.event_name != 'pull_request' ||
34+
github.event.pull_request.head.repo.full_name == github.repository
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 60
37+
permissions:
38+
id-token: write
39+
contents: read
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Install mise
45+
uses: jdx/mise-action@v3
46+
with:
47+
version: 2025.12.10
48+
experimental: true
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Go module cache
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/go/pkg/mod
57+
~/.cache/go-build
58+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
59+
restore-keys: |
60+
${{ runner.os }}-go-
61+
62+
- name: Download Go modules
63+
run: go mod download
64+
65+
- name: Azure login (OIDC)
66+
uses: azure/login@v2
67+
with:
68+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
69+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
70+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
71+
72+
- name: Run Azure integration tests
73+
env:
74+
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
75+
ARM_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
76+
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
77+
ARM_USE_OIDC: "true"
78+
run: |
79+
set -o pipefail
80+
mkdir -p /tmp/logs
81+
# Scope: OIDC-compatible examples only (AzureRM provider >= 3.7).
82+
# Examples on AzureRM 2.x cannot authenticate via OIDC and are
83+
# gated behind a follow-up provider-upgrade effort.
84+
go test -v -p 1 -tags azure -count=1 -timeout 45m \
85+
-run '^(TestTerraformAzureContainerAppExample|TestTerraformAzureKeyVaultExample)$' \
86+
./test/azure/... 2>&1 | tee /tmp/logs/azure-integration-tests.log
87+
88+
- name: Upload test logs
89+
if: always()
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: azure-integration-test-logs
93+
path: /tmp/logs/
94+
retention-days: 14

.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

0 commit comments

Comments
 (0)