-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (127 loc) · 4.6 KB
/
integration.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
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
name: integration
on:
push:
branches:
- main
pull_request:
jobs:
single-trust-zone:
name: single trust zone
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build and run tests
run: just build
- name: Get cloud-provider-kind repo
run: |
git clone https://github.com/kubernetes-sigs/cloud-provider-kind
- name: Generate cloud-provider-kind cache key
id: cloud-provider-cache
run: |
# echo "hash=$(cd cloud-provider-kind && find . -type f -exec sha256sum {} \; | sort | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
echo "hash=$(cd cloud-provider-kind && git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache cloud-provider-kind image
uses: actions/cache@v3
with:
path: /tmp/cloud-provider-kind-image
key: cloud-provider-kind-${{ steps.cloud-provider-cache.outputs.hash }}
- name: Load cached image
if: steps.cloud-provider-cache.outputs.cache-hit == 'true'
run: docker load < /tmp/cloud-provider-kind-image
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@v3
- name: Build cloud-provider-kind image
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/build-push-action@v6
with:
context: ./cloud-provider-kind
push: false
tags: cloud-provider-kind-cloud-provider:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/cloud-provider-kind-image
- name: Install kind
run: just install-kind
- name: Install ko
uses: ko-build/[email protected]
env:
KO_DOCKER_REPO: kind.local
- name: Create a kind cluster
run: just create-kind-cluster
- name: Test
run: just integration-test single-trust-zone
federation:
name: federation
runs-on: ubuntu-latest
strategy:
matrix:
# Repeat the test with in-process plugins and the test gRPC plugin.
plugin:
- ""
- "cofidectl-test-plugin"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build and run tests
run: just build
- name: Get cloud-provider-kind repo
run: |
git clone https://github.com/kubernetes-sigs/cloud-provider-kind
- name: Generate cloud-provider-kind cache key
id: cloud-provider-cache
run: |
# echo "hash=$(cd cloud-provider-kind && find . -type f -exec sha256sum {} \; | sort | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
echo "hash=$(cd cloud-provider-kind && git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Cache cloud-provider-kind image
uses: actions/cache@v3
with:
path: /tmp/cloud-provider-kind-image
key: cloud-provider-kind-${{ steps.cloud-provider-cache.outputs.hash }}
- name: Load cached image
if: steps.cloud-provider-cache.outputs.cache-hit == 'true'
run: docker load < /tmp/cloud-provider-kind-image
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@v3
- name: Build cloud-provider-kind image
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/build-push-action@v6
with:
context: ./cloud-provider-kind
push: false
tags: cloud-provider-kind-cloud-provider:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/cloud-provider-kind-image
- name: Build and install test plugin
run: just install-test-plugin
if: ${{ matrix.plugin == 'cofidectl-test-plugin' }}
- name: Install kind
run: just install-kind
- name: Install ko
uses: ko-build/[email protected]
env:
KO_DOCKER_REPO: kind.local
- name: Create kind clusters
run: just create-kind-clusters 2
- name: Test
run: just integration-test federation
env:
DATA_SOURCE_PLUGIN: ${{ matrix.plugin }}
PROVISION_PLUGIN: ${{ matrix.plugin }}