-
Notifications
You must be signed in to change notification settings - Fork 38
158 lines (128 loc) · 3.9 KB
/
test-integration.yml
File metadata and controls
158 lines (128 loc) · 3.9 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Integration Tests
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
skaffold-build:
name: Test Skaffold Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Skaffold
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
sudo install skaffold /usr/local/bin/
skaffold config set --global collect-metrics false
- name: Build worker-controller image
run: |
skaffold build --profile worker-controller --push=false
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
- name: Build helloworld worker image
run: |
skaffold build --profile helloworld-worker --push=false
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
# Verify that the demo worker patch applies successfully and builds.
- name: Build helloworld worker image patch
run: |
git apply internal/demo/helloworld/changes/no-version-gate.patch
skaffold build --profile helloworld-worker --push=false
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
test-integration:
name: Run Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: setup go workspace
run: go work init && go work use -r .
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.work
cache-dependency-path: |
go.work.sum
**/go.sum
check-latest: true
cache: true
- name: Install Temporal CLI
run: |
curl -sSf https://temporal.download/cli.sh | sh
echo "$HOME/.temporalio/bin" >> "$GITHUB_PATH"
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: 'v3.14.3'
- name: Install controller-gen
run: |
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.19.0
- name: Install envtest
run: |
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
- name: Download dependencies
run: go mod download
- name: Run integration tests
run: make test-integration
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
cover.out
bin/
retention-days: 7
unit-test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: setup go workspace
run: go work init && go work use -r .
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.work
cache-dependency-path: |
go.work.sum
**/go.sum
check-latest: true
cache: true
- name: Download dependencies
run: go mod download
- name: Install Helm
uses: azure/setup-helm@v3
- name: Build Helm chart dependencies
run: helm repo add jetstack https://charts.jetstack.io && helm dependency build helm/temporal-worker-controller
- name: Run unit tests
run: make test-unit
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: |
cover.out
bin/
retention-days: 7