forked from hazelcast/hazelcast
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (90 loc) · 3.04 KB
/
k8s-terraform-integration-tests.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Kubernetes Discovery Plugin Tests
on:
workflow_dispatch:
pull_request_target:
types:
- labeled
branches:
- "master"
- "*.z"
paths:
- "hazelcast/src/main/java/com/hazelcast/kubernetes/**"
env:
GAR_PROJECT_ID: hazelcast-33
GAR_REGION: us-east1
GAR_REPO: auto-discovery-test-suite
AWS_REGION: us-east-1
jobs:
build:
name: Build Jar's And Docker Images
if: >-
github.repository_owner == 'hazelcast' &&
( github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request_target' &&
github.event.action == 'labeled' &&
github.event.label.name == 'run-discovery-tests'
)
)
uses: ./.github/workflows/build-artifact.yml
secrets: inherit
test:
name: Run Tests
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
suite: ["gke"]
steps:
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Get Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
DEVOPS_GITHUB_TOKEN,CN/DEVOPS_GITHUB_TOKEN
GCLOUD_KEYFILE_JSON,CN/GKE_SA_KEY
- name: Authenticate to GCP
uses: google-github-actions/[email protected]
with:
credentials_json: ${{ env.GCLOUD_KEYFILE_JSON }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
install_components: "gke-gcloud-auth-plugin,kubectl"
- name: Copy kubeconfig
run: |
mkdir ${HOME}/.kube/
touch ${HOME}/.kube/config
kubectl config view > ${HOME}/.kube/config
- name: Checkout Auto Discovery Test Suite
uses: actions/checkout@v4
with:
repository: hazelcast/auto-discovery-test-suite
token: ${{ env.DEVOPS_GITHUB_TOKEN }}
path: auto-discovery-suite
- name: Set-up Terraform
uses: hashicorp/[email protected]
with:
terraform_version: 1.5.4
terraform_wrapper: false
- name: Cache Golang dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Add env vars
run: |
echo "GCLOUD_SA=$(gcloud auth list --filter=status:ACTIVE --format="value(account)")" >> "$GITHUB_ENV"
echo "GCLOUD_ID_TOKEN=$(gcloud auth print-identity-token)" >> "$GITHUB_ENV"
- name: Run Tests
working-directory: auto-discovery-suite/terraform/test
run: |
go test -v -timeout 120m -run TestSuite -suite ${{ matrix.suite }} -member-image ${{ needs.build.outputs.HZ_IMG }} -client-image ${{ needs.build.outputs.CL_IMG }}