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 :
@@ -35,84 +40,44 @@ jobs:
35
40
- name : Run tests
36
41
uses : ./.github/actions/run-tests
37
42
env :
43
+ GOROOT :
38
44
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
45
+ - name : Verify
46
+ run : make verify
47
+ - name : Run E2E tests
67
48
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
49
+ CREATE_CLUSTER : false
50
+ run : make e2e
89
51
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
52
+ kind-linux-arm64 :
53
+ # Hosted on Equinix
54
+ # Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
55
+ runs-on : [self-hosted, Linux, ARM64, equinix]
56
+ steps :
57
+ - name : Checkout
58
+ uses : actions/checkout@v2
59
+ - name : Setup Go
60
+ uses : actions/setup-go@v2
61
+ with :
62
+ go-version : 1.17.x
63
+ - name : Prepare
64
+ id : prep
101
65
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
66
+ echo ::set-output name=CLUSTER::arm64-${GITHUB_SHA:0:7}-$(date +%s)
67
+ echo ::set-output name=CONTEXT::kind-arm64-${GITHUB_SHA:0:7}-$(date +%s)
68
+ - name : Setup Kubernetes Kind
106
69
run : |
107
- kubectl -n source-system logs deploy/source-controller
108
- - name : Debug failure
109
- if : failure()
70
+ kind create cluster --name ${{ steps.prep.outputs.CLUSTER }} --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }}
71
+ - name : Run e2e tests
72
+ env :
73
+ KIND_CLUSTER_NAME : ${{ steps.prep.outputs.CLUSTER }}
74
+ KUBECONFIG : /tmp/${{ steps.prep.outputs.CLUSTER }}
75
+ CREATE_CLUSTER : false
76
+ BUILD_PLATFORM : linux/arm64
77
+ MINIO_TAG : RELEASE.2020-09-17T04-49-20Z-arm64
78
+ run : make e2e
79
+ - name : Cleanup
80
+ if : always()
110
81
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
82
+ kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }}
83
+ rm /tmp/${{ steps.prep.outputs.CLUSTER }}
0 commit comments