-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
133 lines (111 loc) · 3.58 KB
/
Copy pathk8s-tests.yml
File metadata and controls
133 lines (111 loc) · 3.58 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Kubernetes Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
K8S_VERSION: "v1.28.0"
jobs:
kubernetes-tests:
name: Kubernetes Tests
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2025.12.10
experimental: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Go module cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
run: go mod download
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::087285199408:role/terratest-gha
aws-region: us-east-1
- name: Start minikube
run: minikube start --driver=docker --kubernetes-version=${{ env.K8S_VERSION }}
- name: Run k8s module tests
run: |
mkdir -p /tmp/logs
go test -v -tags kubernetes -count=1 -timeout 20m ./modules/k8s/... 2>&1 | tee /tmp/logs/test_output.log
- name: Run k8s integration tests
run: |
go test -v -tags kubernetes -run TestKubernetes -count=1 -timeout 20m ./test/... 2>&1 | tee -a /tmp/logs/test_output.log
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: kubernetes-test-logs
path: /tmp/logs/
retention-days: 14
helm-tests:
name: Helm Tests
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v3
with:
version: 2025.12.10
experimental: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Go module cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go modules
run: go mod download
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::087285199408:role/terratest-gha
aws-region: us-east-1
- name: Start minikube
run: minikube start --driver=docker --kubernetes-version=${{ env.K8S_VERSION }}
- name: Run helm module tests
run: |
mkdir -p /tmp/logs
go test -v -tags helm -count=1 -timeout 20m ./modules/helm/... 2>&1 | tee /tmp/logs/test_output.log
- name: Run helm integration tests
run: |
go test -v -tags helm -run TestHelm -count=1 -timeout 20m ./test/... 2>&1 | tee -a /tmp/logs/test_output.log
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: helm-test-logs
path: /tmp/logs/
retention-days: 14