1
- # Copyright 2020 The OpenEBS Authors. All rights reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- name : build
1
+ name : Build and Push
15
2
16
3
on :
17
- create :
18
4
push :
19
5
branches :
20
- - ' develop'
21
- - ' v* '
6
+ - develop
7
+ - " release/** "
22
8
paths-ignore :
23
- - ' *.md'
24
- - ' BUILDMETA'
25
- - ' changelogs/**'
26
- - ' deploy/helm/** '
27
- - ' docs /**'
28
- - ' LICENSE'
29
- - ' MAINTAINERS'
9
+ - " *.md"
10
+ - " BUILDMETA"
11
+ - " changelogs/**"
12
+ - " docs/** "
13
+ - " design /**"
14
+ - " LICENSE"
15
+ - " MAINTAINERS"
30
16
31
17
jobs :
32
18
lint :
33
- # to ignore builds on release
34
- if : ${{ (github.event.ref_type != 'tag') }}
35
19
runs-on : ubuntu-latest
36
20
steps :
37
21
- name : Checkout
38
22
uses : actions/checkout@v4
39
-
40
- - name : Shellcheck
41
- uses : reviewdog/action-shellcheck@v1
42
23
with :
43
- github_token : ${{ secrets.github_token }}
44
- reporter : github-pr-review
45
- path : ' .'
46
- pattern : ' *.sh'
47
- exclude : ' ./.git/*'
24
+ fetch-depth : 0
48
25
49
- - name : Set up Go 1.19
50
- uses : actions/setup-go@v5
26
+ - uses : cachix/install-nix-action@v22
27
+ - uses :
rrbutani/[email protected]
51
28
with :
52
- go-version : 1.19.9
53
- cache : false
29
+ file : shell.nix
54
30
55
- - name : Lint Check
56
- uses : golangci/golangci-lint-action@v4
57
- with :
58
- version : v1.56.2
59
- args : -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s
31
+ - name : Check if the chart follows a valid semver version
32
+ run : |
33
+ BRANCH=${{ github.ref_name }}
34
+ ./scripts/validate-chart-version.sh --branch $BRANCH
35
+
36
+ - name : Run chart-testing lint
37
+ run : |
38
+ ct lint --config ct.yaml
60
39
61
- unit-test :
62
- # to ignore builds on release
63
- if : ${{ (github.event.ref_type != 'tag') }}
40
+ unit-tests :
64
41
runs-on : ubuntu-latest
65
42
steps :
66
43
- name : Checkout
@@ -76,15 +53,15 @@ jobs:
76
53
run : make test
77
54
78
55
- name : Upload Coverage Report
79
- uses : codecov/codecov-action@v4
56
+ uses : codecov/codecov-action@v4
80
57
with :
81
58
token : ${{ secrets.CODECOV_TOKEN }}
82
59
file : ./coverage.txt
83
60
name : coverage-$(date +%s)
84
61
flags : unittests
85
62
86
- bdd-test :
87
- needs : [' unit-test' ]
63
+ bdd-tests :
64
+ needs : [" unit-tests" ]
88
65
runs-on : ubuntu-latest
89
66
strategy :
90
67
fail-fast : true
108
85
driver : none
109
86
kubernetes-version : ${{ matrix.kubernetes }}
110
87
cni : calico
111
- start-args : ' --install-addons=false'
88
+ start-args : " --install-addons=false"
112
89
113
90
- name : Build images locally
114
91
run : make lvm-driver-image || exit 1;
117
94
run : make bootstrap
118
95
119
96
- name : Running tests
97
+ env :
98
+ OPENEBS_NAMESPACE : " openebs"
120
99
run : ./ci/ci-test.sh
121
100
122
101
- name : Upload Coverage Report
@@ -127,44 +106,14 @@ jobs:
127
106
name : coverage-bdd_coverage-$(date +%s)
128
107
flags : bddtests
129
108
130
- ansible :
131
- runs-on : ubuntu-latest
132
- needs : ['lint', 'unit-test', 'bdd-test']
133
- steps :
134
- - name : Checkout
135
- uses : actions/checkout@v4
136
-
137
- - name : Set Image Org
138
- # sets the default IMAGE_ORG to openebs
139
- run : |
140
- [ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
141
- echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
142
-
143
- - name : Login to Docker Hub
144
- uses : docker/login-action@v3
145
- with :
146
- username : ${{ secrets.DOCKERHUB_USERNAME }}
147
- password : ${{ secrets.DOCKERHUB_TOKEN }}
148
-
149
- - name : Build and push the ansible image
150
- uses : docker/build-push-action@v5
151
- with :
152
- file : ./e2e-tests/Dockerfile
153
- push : true
154
- load : false
155
- platforms : linux/amd64
156
- tags : |
157
- ${{ env.IMAGE_ORG }}/lvm-localpv-e2e:ci
158
-
159
109
csi-driver :
160
110
runs-on : ubuntu-latest
161
- needs : [' lint', 'unit-test', ' bdd-test' ]
111
+ needs : [" lint", " bdd-tests" ]
162
112
steps :
163
113
- name : Checkout
164
114
uses : actions/checkout@v4
165
115
166
116
- name : Set Image Org
167
- # sets the default IMAGE_ORG to openebs
168
117
run : |
169
118
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG }}
170
119
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
@@ -174,15 +123,11 @@ jobs:
174
123
run : |
175
124
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
176
125
177
- - name : Set Tag
126
+ - name : Set IMAGE_TAG and BRANCH
178
127
run : |
179
- BRANCH="${GITHUB_REF##*/}"
180
- CI_TAG=${BRANCH#v}-ci
181
- if [ ${BRANCH} = "develop" ]; then
182
- CI_TAG="ci"
183
- fi
184
- echo "TAG=${CI_TAG}" >> $GITHUB_ENV
185
- echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
128
+ BRANCH=${{ github.ref_name }}
129
+ echo "BRANCH=$BRANCH" >> $GITHUB_ENV
130
+ echo "IMAGE_TAG=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV
186
131
187
132
- name : Docker meta
188
133
id : docker_meta
@@ -195,11 +140,11 @@ jobs:
195
140
ghcr.io/${{ env.IMAGE_ORG }}/lvm-driver
196
141
tags : |
197
142
type=raw,value=latest,enable=false
198
- type=raw,value=${{ env.TAG }}
143
+ type=raw,value=${{ env.IMAGE_TAG }}
199
144
200
145
- name : Print Tag info
201
146
run : |
202
- echo "BRANCH: ${BRANCH}"
147
+ echo "BRANCH: ${{ env. BRANCH } }"
203
148
echo "${{ steps.docker_meta.outputs.tags }}"
204
149
205
150
- name : Set up QEMU
@@ -247,3 +192,14 @@ jobs:
247
192
DBUILD_REPO_URL=https://github.com/openebs/lvm-localpv
248
193
DBUILD_SITE_URL=https://openebs.io
249
194
BRANCH=${{ env.BRANCH }}
195
+
196
+ release-chart :
197
+ runs-on : ubuntu-latest
198
+ needs : ["csi-driver"]
199
+ steps :
200
+ - uses : actions/checkout@v4
201
+ - name : Publish lvm localpv develop or prerelease helm chart
202
+ uses : stefanprodan/helm-gh-pages@master
203
+ with :
204
+ token : ${{ secrets.GITHUB_TOKEN }}
205
+ charts_dir : ./deploy/helm
0 commit comments