@@ -28,11 +28,20 @@ jobs:
28
28
id : list-changed
29
29
run : |
30
30
changed=$(ct list-changed --config ct.yaml)
31
- if [[ -n "$changed" ]]; then
32
- echo "::set-output name=changed::true"
33
- fi
31
+ touch /tmp/kind-ci
32
+ touch /tmp/gke-ci
33
+ for dir in $changed; do
34
+ if [[ $(yq e '.annotations."weave.works/profile-ci"|contains("kind")' $dir/Chart.yaml) = "true" ]]; then
35
+ echo $dir >> /tmp/kind-ci
36
+ echo "::set-output name=kind-ci::true"
37
+ fi
38
+ if [[ $(yq e '.annotations."weave.works/profile-ci"|contains("gke")' $dir/Chart.yaml) = "true" ]]; then
39
+ echo $dir >> /tmp/gke-ci
40
+ echo "::set-output name=gke-ci::true"
41
+ fi
42
+ done
34
43
35
- - name : Add dependencies
44
+ - name : Add helm dependencies
36
45
shell : bash
37
46
run : |
38
47
for dir in $(ls -d charts/*/ | cut -f2 -d'/'); do
@@ -49,13 +58,44 @@ jobs:
49
58
done
50
59
done
51
60
done
52
-
61
+
53
62
- name : Run chart-testing (lint)
54
63
run : ct lint --config ct.yaml
55
64
56
65
- name : Create kind cluster
66
+ if : steps.list-changed.outputs.kind-ci == 'true'
57
67
58
- if : steps.list-changed.outputs.changed == 'true'
59
68
60
- - name : Run chart-testing (install)
61
- run : ct install --config ct.yaml
69
+ - name : Run chart-testing on Kind (install)
70
+ if : steps.list-changed.outputs.kind-ci == 'true'
71
+ run : ct install --config ct.yaml --charts $(awk '{print $1}' /tmp/kind-ci | paste -s -d, -)
72
+
73
+ - name : Set up Google Cloud SDK
74
+ if : steps.list-changed.outputs.gke-ci == 'true'
75
+ uses : google-github-actions/setup-gcloud@master
76
+ with :
77
+ project_id : ${{ secrets.GCP_PROJECT_ID }}
78
+ service_account_key : ${{ secrets.GCP_SA_KEY }}
79
+ export_default_credentials : true
80
+
81
+ - name : Create gke cluster
82
+ if : steps.list-changed.outputs.gke-ci == 'true'
83
+ shell : bash
84
+ env :
85
+ GKE_CLUSTER_NAME : profiles-test-mgmt-${{ github.head_ref }}-${{ github.run_number }}
86
+ INFRASTRUCTURE : " gke"
87
+ run : |
88
+ make create-cluster
89
+
90
+ - name : Run chart-testing on gke (install)
91
+ if : steps.list-changed.outputs.gke-ci == 'true'
92
+ run : ct install --config ct.yaml --charts $(awk '{print $1}' /tmp/gke-ci | paste -s -d, -)
93
+
94
+ - name : Delete gke cluster
95
+ if : steps.list-changed.outputs.gke-ci == 'true'
96
+ shell : bash
97
+ env :
98
+ GKE_CLUSTER_NAME : profiles-test-mgmt-${{ github.head_ref }}-${{ github.run_number }}
99
+ INFRASTRUCTURE : " gke"
100
+ run : |
101
+ make delete-cluster
0 commit comments