-
Notifications
You must be signed in to change notification settings - Fork 20
108 lines (98 loc) · 3.12 KB
/
go-cm-integ-tests.yml
File metadata and controls
108 lines (98 loc) · 3.12 KB
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
105
106
107
108
name: Go SDK cluster management integration tests
on:
push:
branches: [ "main" ]
paths:
- 'go/cluster_management/**'
- '.github/workflows/go-cm-integ-tests.yml'
- '.github/workflows/clean-clusters.yml'
pull_request:
branches: [ "main" ]
paths:
- 'go/cluster_management/**'
- '.github/workflows/go-cm-integ-tests.yml'
- '.github/workflows/clean-clusters.yml'
# Give us a button to allow running the workflow on demand for testing.
workflow_dispatch:
inputs:
tags:
description: 'Manual Workflow Run'
required: false
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
# Explicitly set permissions, following the principle of least privilege
actions: read
checks: write
pull-requests: write
concurrency:
# Ensure only 1 job mutates clusters in this account at a time.
group: ${{ github.workflow }}
env:
GOPROXY: direct
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.2'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.GO_IAM_ROLE }}
aws-region: us-east-1
- name: echo-default-env-variables
run: |
echo "Home: ${HOME}"
echo "GITHUB_WORKFLOW: ${GITHUB_WORKFLOW}"
echo "GITHUB_ACTIONS: ${GITHUB_ACTIONS}"
echo "GITHUB_ACTOR: ${GITHUB_ACTOR}"
echo "GITHUB_REPOSITORY: ${GITHUB_REPOSITORY}"
echo "GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}"
echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}"
echo "GITHUB_RUN_ID: ${GITHUB_RUN_ID}"
echo "GITHUB_SHA: ${GITHUB_SHA}"
echo "GITHUB_REF: ${GITHUB_REF}"
echo "GITHUB_RUN_NUMBER: ${GITHUB_RUN_NUMBER}"
- name: Build & Run Create Multi region
working-directory: ./go/cluster_management/cmd/create_multi_region
run: |
go test
- name: Build & Run Create Single region
working-directory: ./go/cluster_management/cmd/create_single_region
run: |
go test
- name: Build & Run Get Cluster
working-directory: ./go/cluster_management/cmd/get_cluster
run: |
go test
- name: Build & Run Update Cluster
working-directory: ./go/cluster_management/cmd/update_cluster
run: |
go test
- name: Build & Run Delete Single region
working-directory: ./go/cluster_management/cmd/delete_single_region
run: |
go test
- name: Build & Run Delete Multi region
working-directory: ./go/cluster_management/cmd/delete_multi_region
run: |
go test
cleanup:
if: always()
needs: build
uses: ./.github/workflows/clean-clusters.yml
with:
aws_region: 'us-east-1'
secrets:
AWS_IAM_ROLE: ${{ secrets.GO_IAM_ROLE }}
permissions:
id-token: write
contents: read
concurrency:
# Ensure only 1 job mutates clusters in this account at a time.
group: ${{ github.workflow }}