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
4
create :
18
5
push :
19
6
branches :
20
- - ' develop'
21
- - ' v* '
7
+ - develop
8
+ - " release/** "
22
9
paths-ignore :
23
- - ' *.md'
24
- - ' BUILDMETA'
25
- - ' changelogs/**'
26
- - ' deploy/helm/**'
27
- - ' docs/**'
28
- - ' LICENSE'
29
- - ' MAINTAINERS'
10
+ - " *.md"
11
+ - " BUILDMETA"
12
+ - " changelogs/**"
13
+ - " deploy/helm/**"
14
+ - " docs/**"
15
+ - " design/**"
16
+ - " LICENSE"
17
+ - " MAINTAINERS"
30
18
31
19
jobs :
32
20
lint :
33
- # to ignore builds on release
34
- if : ${{ (github.event.ref_type != 'tag') }}
35
21
runs-on : ubuntu-latest
36
22
steps :
37
23
- name : Checkout
38
24
uses : actions/checkout@v4
39
-
40
- - name : Shellcheck
41
- uses : reviewdog/action-shellcheck@v1
42
25
with :
43
- github_token : ${{ secrets.github_token }}
44
- reporter : github-pr-review
45
- path : ' .'
46
- pattern : ' *.sh'
47
- exclude : ' ./.git/*'
26
+ fetch-depth : 0
48
27
49
- - name : Set up Go 1.19
50
- uses : actions/setup-go@v5
28
+ - uses : cachix/install-nix-action@v22
29
+ - uses :
rrbutani/[email protected]
51
30
with :
52
- go-version : 1.19.9
53
- cache : false
31
+ file : shell.nix
54
32
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
33
+ - name : Check if the chart follows a valid semver version
34
+ run : |
35
+ BRANCH=${{ github.ref_name }}
36
+ ./scripts/validate-chart-version.sh --branch $BRANCH
37
+ - name : Run chart-testing lint
38
+ run : |
39
+ ct lint --config ct.yaml
60
40
61
- unit-test :
62
- # to ignore builds on release
63
- if : ${{ (github.event.ref_type != 'tag') }}
41
+ unit-tests :
64
42
runs-on : ubuntu-latest
65
43
steps :
66
44
- name : Checkout
@@ -76,15 +54,15 @@ jobs:
76
54
run : make test
77
55
78
56
- name : Upload Coverage Report
79
- uses : codecov/codecov-action@v4
57
+ uses : codecov/codecov-action@v4
80
58
with :
81
59
token : ${{ secrets.CODECOV_TOKEN }}
82
60
file : ./coverage.txt
83
61
name : coverage-$(date +%s)
84
62
flags : unittests
85
63
86
- bdd-test :
87
- needs : [' unit-test' ]
64
+ bdd-tests :
65
+ needs : [" unit-tests" ]
88
66
runs-on : ubuntu-latest
89
67
strategy :
90
68
fail-fast : true
108
86
driver : none
109
87
kubernetes-version : ${{ matrix.kubernetes }}
110
88
cni : calico
111
- start-args : ' --install-addons=false'
89
+ start-args : " --install-addons=false"
112
90
113
91
- name : Build images locally
114
92
run : make lvm-driver-image || exit 1;
117
95
run : make bootstrap
118
96
119
97
- name : Running tests
98
+ env :
99
+ OPENEBS_NAMESPACE : " openebs"
120
100
run : ./ci/ci-test.sh
121
101
122
102
- name : Upload Coverage Report
@@ -127,44 +107,14 @@ jobs:
127
107
name : coverage-bdd_coverage-$(date +%s)
128
108
flags : bddtests
129
109
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
110
csi-driver :
160
111
runs-on : ubuntu-latest
161
- needs : [' lint', 'unit-test', ' bdd-test' ]
112
+ needs : [" lint", " bdd-tests" ]
162
113
steps :
163
114
- name : Checkout
164
115
uses : actions/checkout@v4
165
116
166
117
- name : Set Image Org
167
- # sets the default IMAGE_ORG to openebs
168
118
run : |
169
119
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG }}
170
120
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
@@ -174,15 +124,11 @@ jobs:
174
124
run : |
175
125
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
176
126
177
- - name : Set Tag
127
+ - name : Set IMAGE_TAG and BRANCH
178
128
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
129
+ BRANCH=${{ github.ref_name }}
130
+ echo "BRANCH=$BRANCH" >> $GITHUB_ENV
131
+ echo "IMAGE_TAG=$(awk -F': ' '/^version:/ {print $$2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV
186
132
187
133
- name : Docker meta
188
134
id : docker_meta
@@ -195,11 +141,11 @@ jobs:
195
141
ghcr.io/${{ env.IMAGE_ORG }}/lvm-driver
196
142
tags : |
197
143
type=raw,value=latest,enable=false
198
- type=raw,value=${{ env.TAG }}
144
+ type=raw,value=${{ env.IMAGE_TAG }}
199
145
200
146
- name : Print Tag info
201
147
run : |
202
- echo "BRANCH: ${BRANCH}"
148
+ echo "BRANCH: ${env. BRANCH}"
203
149
echo "${{ steps.docker_meta.outputs.tags }}"
204
150
205
151
- name : Set up QEMU
@@ -247,3 +193,14 @@ jobs:
247
193
DBUILD_REPO_URL=https://github.com/openebs/lvm-localpv
248
194
DBUILD_SITE_URL=https://openebs.io
249
195
BRANCH=${{ env.BRANCH }}
196
+
197
+ release-chart :
198
+ runs-on : ubuntu-latest
199
+ needs : ["csi-driver"]
200
+ steps :
201
+ - uses : actions/checkout@v4
202
+ - name : Publish lvm localpv develop or prerelease helm chart
203
+ uses : stefanprodan/helm-gh-pages@master
204
+ with :
205
+ token : ${{ secrets.GITHUB_TOKEN }}
206
+ charts_dir : ./deploy/helm
0 commit comments