7
7
- main
8
8
9
9
jobs :
10
- kind :
10
+
11
+ kind-linux-amd64 :
11
12
runs-on : ubuntu-latest
12
13
steps :
13
14
- name : Checkout
14
15
uses : actions/checkout@v2
16
+ - name : Setup Go
17
+ uses : actions/setup-go@v2
18
+ with :
19
+ go-version : 1.17.x
15
20
- name : Restore Go cache
16
21
uses : actions/cache@v1
17
22
with :
@@ -26,93 +31,49 @@ jobs:
26
31
image : kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
27
32
- name : Setup Kustomize
28
33
uses : fluxcd/pkg/actions/kustomize@main
29
- - name : Setup envtest
30
- uses : fluxcd/pkg/actions/envtest@main
31
- with :
32
- version : " 1.19.2"
33
34
- name : Setup Helm
34
35
uses : fluxcd/pkg/actions/helm@main
35
36
- name : Run tests
36
37
uses : ./.github/actions/run-tests
37
38
env :
39
+ GOROOT :
38
40
GOPATH : /github/home/go
39
- - name : Check if working tree is dirty
40
- run : |
41
- if [[ $(git diff --stat) != '' ]]; then
42
- git --no-pager diff
43
- echo 'run make test and commit changes'
44
- exit 1
45
- fi
46
- - name : Build container image
47
- run : make docker-build IMG=test/source-controller TAG=latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load
48
- - name : Load test image
49
- run : kind load docker-image test/source-controller:latest
50
- - name : Deploy controller
51
- run : make dev-deploy IMG=test/source-controller TAG=latest
52
- - name : Run smoke tests
53
- run : |
54
- kubectl -n source-system apply -f ./config/samples
55
- kubectl -n source-system rollout status deploy/source-controller --timeout=1m
56
- kubectl -n source-system wait gitrepository/gitrepository-sample --for=condition=ready --timeout=1m
57
- kubectl -n source-system wait helmrepository/helmrepository-sample --for=condition=ready --timeout=1m
58
- kubectl -n source-system wait helmchart/helmchart-sample --for=condition=ready --timeout=1m
59
- kubectl -n source-system delete -f ./config/samples
60
- - name : Run HelmChart values file tests
61
- run : |
62
- kubectl -n source-system apply -f ./config/testdata/helmchart-valuesfile
63
- kubectl -n source-system wait helmchart/podinfo --for=condition=ready --timeout=5m
64
- kubectl -n source-system wait helmchart/podinfo-git --for=condition=ready --timeout=5m
65
- kubectl -n source-system delete -f ./config/testdata/helmchart-valuesfile
66
- - name : Setup Minio
41
+ - name : Verify
42
+ run : make verify
43
+ - name : Run E2E tests
67
44
env :
68
- MINIO_VER : ${{ 'v6.3.1' }}
69
- run : |
70
- kubectl create ns minio
71
- helm repo add minio https://helm.min.io/
72
- helm upgrade --wait -i minio minio/minio \
73
- --version $MINIO_VER \
74
- --namespace minio \
75
- --set accessKey=myaccesskey \
76
- --set secretKey=mysecretkey \
77
- --set resources.requests.memory=128Mi \
78
- --set persistence.enable=false
79
- kubectl -n minio port-forward svc/minio 9000:9000 &>/dev/null &
80
- sleep 2
81
- wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
82
- chmod +x mc
83
- ./mc alias set minio http://localhost:9000 myaccesskey mysecretkey --api S3v4
84
- kubectl -n source-system apply -f ./config/testdata/minio/secret.yaml
85
- - name : Run Bucket tests
86
- run : |
87
- ./mc mb minio/podinfo
88
- ./mc mirror ./config/testdata/minio/manifests/ minio/podinfo
45
+ CREATE_CLUSTER : false
46
+ run : make e2e
89
47
90
- kubectl -n source-system apply -f ./config/testdata/bucket/source.yaml
91
- kubectl -n source-system wait bucket/podinfo --for=condition=ready --timeout=1m
92
- - name : Run HelmChart from Bucket tests
93
- run : |
94
- ./mc mb minio/charts
95
- ./mc mirror ./controllers/testdata/charts/helmchart/ minio/charts/helmchart
96
-
97
- kubectl -n source-system apply -f ./config/testdata/helmchart-from-bucket/source.yaml
98
- kubectl -n source-system wait bucket/charts --for=condition=ready --timeout=1m
99
- kubectl -n source-system wait helmchart/helmchart-bucket --for=condition=ready --timeout=1m
100
- - name : Run large Git repo tests
48
+ kind-linux-arm64 :
49
+ # Hosted on Equinix
50
+ # Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
51
+ runs-on : [self-hosted, Linux, ARM64, equinix]
52
+ steps :
53
+ - name : Checkout
54
+ uses : actions/checkout@v2
55
+ - name : Setup Go
56
+ uses : actions/setup-go@v2
57
+ with :
58
+ go-version : 1.17.x
59
+ - name : Prepare
60
+ id : prep
101
61
run : |
102
- kubectl -n source-system apply -f ./config/testdata/git/large-repo.yaml
103
- kubectl -n source-system wait gitrepository/large-repo-go-git --for=condition=ready --timeout=2m
104
- kubectl -n source-system wait gitrepository/large-repo-libgit2 --for=condition=ready --timeout=2m
105
- - name : Logs
62
+ echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
63
+ echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
64
+ - name : Setup Kubernetes Kind
106
65
run : |
107
- kubectl -n source-system logs deploy/source-controller
108
- - name : Debug failure
109
- if : failure()
66
+ kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
67
+ - name : Run e2e tests
68
+ env :
69
+ KIND_CLUSTER_NAME : ${{ steps.prep.outputs.CLUSTER }}
70
+ KUBECONFIG : /tmp/${{ steps.prep.outputs.CLUSTER }}
71
+ CREATE_CLUSTER : false
72
+ BUILD_PLATFORM : linux/arm64
73
+ MINIO_TAG : RELEASE.2020-09-17T04-49-20Z-arm64
74
+ run : make e2e
75
+ - name : Cleanup
76
+ if : always()
110
77
run : |
111
- kubectl -n kube-system describe pods
112
- kubectl -n source-system describe pods
113
- kubectl -n source-system get gitrepositories -oyaml
114
- kubectl -n source-system get helmrepositories -oyaml
115
- kubectl -n source-system get helmcharts -oyaml
116
- kubectl -n source-system get all
117
- kubectl -n source-system logs deploy/source-controller
118
- kubectl -n minio get all
78
+ kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
79
+ rm /tmp/${{ steps.prep.outputs.CLUSTER }}
0 commit comments