Skip to content

Commit 3ce5a7d

Browse files
authored
fix(ci): build images before running sanity test (#129)
This commit has the following changes: - Build images before running sanity test - Add docs dir exclusion - Change the order of steps in sanity test workflow - Add BackendStorageClass to sanity-tests where it is missing Signed-off-by: Niladri Halder <niladri.halder@mayadata.io>
1 parent 347ab2f commit 3ce5a7d

File tree

7 files changed

+109
-73
lines changed

7 files changed

+109
-73
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- 'v*'
2222
paths-ignore:
2323
- 'deploy/helm/**'
24+
- 'docs/**'
2425
- 'MAINTAINERS'
2526
- '*.md'
2627
- 'LICENSE'
@@ -53,14 +54,58 @@ jobs:
5354

5455
- name: Upload Coverage Report
5556
uses: codecov/codecov-action@v1
57+
58+
sanity-test:
59+
# to ignore builds on release
60+
if: ${{ (github.event.ref_type != 'tag') }}
61+
runs-on: ubuntu-latest
62+
needs: ['lint', 'unit-test']
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v2
5666

67+
- name: Set up Go 1.15
68+
uses: actions/setup-go@v2
69+
with:
70+
go-version: 1.15.15
71+
72+
- name: Build provisioner-nfs image
73+
run: make provisioner-nfs-image
74+
75+
- name: Build nfs-server-alpine image
76+
run: make nfs-server-image
77+
78+
- name: Install NFS utils
79+
run: |
80+
sudo apt-get update && sudo apt-get install -y nfs-common
81+
82+
- name: Setup Minikube-Kubernetes
83+
uses: manusa/actions-setup-minikube@v2.4.2
84+
with:
85+
minikube version: v1.24.0
86+
kubernetes version: v1.20.13
87+
start args: '--install-addons=false'
88+
89+
- name: Installation
90+
run: |
91+
./tests/install-localpv.sh
92+
./tests/install-nfs-provisioner.sh
93+
94+
- name: Running sanity tests
95+
run: make sanity-test
96+
5797
provisioner-nfs:
5898
runs-on: ubuntu-latest
5999
needs: ['lint', 'unit-test']
60100
steps:
61101
- name: Checkout
62102
uses: actions/checkout@v2
63103

104+
- name: Set up Go 1.15
105+
uses: actions/setup-go@v2
106+
with:
107+
go-version: 1.15.15
108+
64109
- name: Set Image Org
65110
# sets the default IMAGE_ORG to openebs
66111
run: |
@@ -225,39 +270,6 @@ jobs:
225270
tags: |
226271
${{ steps.docker_meta.outputs.tags }}
227272
228-
sanity-test:
229-
# to ignore builds on release
230-
if: ${{ (github.event.ref_type != 'tag') }}
231-
runs-on: ubuntu-latest
232-
needs: ['provisioner-nfs', 'nfs-server']
233-
steps:
234-
- name: Checkout
235-
uses: actions/checkout@v2
236-
237-
- name: Set up Go 1.15
238-
uses: actions/setup-go@v2
239-
with:
240-
go-version: 1.15
241-
242-
- name: Setup Minikube-Kubernetes
243-
uses: manusa/actions-setup-minikube@v2.3.0
244-
with:
245-
minikube version: v1.16.0
246-
kubernetes version: v1.20.1
247-
248-
- name: Install NFS utils
249-
run: |
250-
sudo apt-get update
251-
sudo apt install nfs-common
252-
253-
- name: Installation
254-
run: |
255-
./tests/install-localpv.sh
256-
./tests/install-nfs-provisioner.sh
257-
258-
- name: Running sanity tests
259-
run: make sanity-test
260-
261273
nfs-e2e:
262274
runs-on: ubuntu-latest
263275
steps:
@@ -283,4 +295,4 @@ jobs:
283295
load: false
284296
platforms: linux/amd64
285297
tags: |
286-
${{ env.IMAGE_ORG }}/nfs-e2e:ci
298+
${{ env.IMAGE_ORG }}/nfs-e2e:ci

.github/workflows/pull_request.yml

Lines changed: 45 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
pull_request:
1919
paths-ignore:
2020
- 'deploy/helm/**'
21+
- 'docs/**'
2122
- 'MAINTAINERS'
2223
- '*.md'
2324
- 'LICENSE'
@@ -51,13 +52,57 @@ jobs:
5152
- name: Upload Coverage Report
5253
uses: codecov/codecov-action@v1
5354

55+
sanity-test:
56+
# to ignore builds on release
57+
if: ${{ (github.event.ref_type != 'tag') }}
58+
runs-on: ubuntu-latest
59+
needs: ['lint', 'unit-test']
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v2
63+
64+
- name: Set up Go 1.15
65+
uses: actions/setup-go@v2
66+
with:
67+
go-version: 1.15.15
68+
69+
- name: Build provisioner-nfs image
70+
run: make provisioner-nfs-image
71+
72+
- name: Build nfs-server-alpine image
73+
run: make nfs-server-image
74+
75+
- name: Install NFS utils
76+
run: |
77+
sudo apt-get update && sudo apt-get install -y nfs-common
78+
79+
- name: Setup Minikube-Kubernetes
80+
uses: manusa/actions-setup-minikube@v2.4.2
81+
with:
82+
minikube version: v1.24.0
83+
kubernetes version: v1.20.13
84+
start args: '--install-addons=false'
85+
86+
- name: Installation
87+
run: |
88+
./tests/install-localpv.sh
89+
./tests/install-nfs-provisioner.sh
90+
91+
- name: Running sanity tests
92+
run: make sanity-test
93+
5494
provisioner-nfs:
5595
runs-on: ubuntu-latest
5696
needs: ['lint', 'unit-test']
5797
steps:
5898
- name: Checkout
5999
uses: actions/checkout@v2
60100

101+
- name: Set up Go 1.15
102+
uses: actions/setup-go@v2
103+
with:
104+
go-version: 1.15.15
105+
61106
- name: Setup QEMU
62107
uses: docker/setup-qemu-action@v1
63108
with:
@@ -107,42 +152,6 @@ jobs:
107152
tags: |
108153
openebs/nfs-server-alpine:ci
109154
110-
sanity-test:
111-
# to ignore builds on release
112-
if: ${{ (github.event.ref_type != 'tag') }}
113-
runs-on: ubuntu-latest
114-
needs: ['provisioner-nfs', 'nfs-server']
115-
steps:
116-
- name: Checkout
117-
uses: actions/checkout@v2
118-
119-
- name: Set up Go 1.15
120-
uses: actions/setup-go@v2
121-
with:
122-
go-version: 1.14.7
123-
124-
- name: Setup Minikube-Kubernetes
125-
uses: manusa/actions-setup-minikube@v2.3.0
126-
with:
127-
minikube version: v1.16.0
128-
kubernetes version: v1.20.1
129-
130-
- name: Build and NFS-Provisioner image
131-
run: make provisioner-nfs-image
132-
133-
- name: Install NFS utils
134-
run: |
135-
sudo apt-get update
136-
sudo apt install nfs-common
137-
138-
- name: Installation
139-
run: |
140-
./tests/install-localpv.sh
141-
./tests/install-nfs-provisioner.sh
142-
143-
- name: Running sanity tests
144-
run: make sanity-test
145-
146155
nfs-e2e:
147156
runs-on: ubuntu-latest
148157
steps:

buildscripts/provisioner-nfs/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#See the License for the specific language governing permissions and
1313
#limitations under the License.
1414
#
15-
FROM alpine:3.11.5
15+
FROM alpine:3.12
1616

1717
RUN apk add --no-cache \
1818
iproute2 \
@@ -51,4 +51,4 @@ LABEL org.label-schema.build-date=$DBUILD_DATE
5151
LABEL org.label-schema.vcs-url=$DBUILD_REPO_URL
5252
LABEL org.label-schema.url=$DBUILD_SITE_URL
5353

54-
CMD ["/provisioner-nfs"]
54+
ENTRYPOINT ["/provisioner-nfs"]

buildscripts/provisioner-nfs/provisioner-nfs.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
FROM golang:1.14.7 as build
15+
FROM golang:1.15.15 as build
1616

1717
ARG TARGETOS
1818
ARG TARGETARCH

tests/nfs_claim_released_pv.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var _ = Describe("TEST RECLAIM OF RELEASED NFS PV", func() {
5757
// nfs provisioner values
5858
openebsNamespace = "openebs"
5959
scName = "nfs-pv-sc-retain"
60+
backendSCName = "openebs-hostpath"
6061
scReclaimPolicy = corev1.PersistentVolumeReclaimRetain
6162
scNfsServerType = "kernel"
6263
// nfsPv stores pv name created by application pvc
@@ -71,6 +72,10 @@ var _ = Describe("TEST RECLAIM OF RELEASED NFS PV", func() {
7172
Name: provisioner.KeyPVNFSServerType,
7273
Value: scNfsServerType,
7374
},
75+
{
76+
Name: provisioner.KeyPVBackendStorageClass,
77+
Value: backendSCName,
78+
},
7479
}
7580

7681
casObjStr, err := yaml.Marshal(casObj)

tests/nfs_sc_delayed_binding_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ var _ = Describe("TEST WaitForFirstConsumer binding mode for NFS PV", func() {
6161

6262
NFSScBindingMode = storagev1.VolumeBindingWaitForFirstConsumer
6363
NFSScName = "nfs-sc-waitforfirstconsumer"
64+
backendSCName = "openebs-hostpath"
6465
scNfsServerType = "kernel"
6566
)
6667

@@ -72,6 +73,10 @@ var _ = Describe("TEST WaitForFirstConsumer binding mode for NFS PV", func() {
7273
Name: provisioner.KeyPVNFSServerType,
7374
Value: scNfsServerType,
7475
},
76+
{
77+
Name: provisioner.KeyPVBackendStorageClass,
78+
Value: backendSCName,
79+
},
7580
}
7681

7782
casObjStr, err := yaml.Marshal(casObj)

tests/nfs_server_param_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ var _ = Describe("TEST NFS SERVER CONFIGURATION", func() {
5454
openebsNamespace = "openebs"
5555
nfsServerLabel = "openebs.io/nfs-server"
5656
scName = "nfs-server-config-sc"
57+
backendSCName = "openebs-hostpath"
5758
scNfsServerType = "kernel"
5859
scGraceTime = "30"
5960
scLeaseTime = "30"
@@ -84,6 +85,10 @@ var _ = Describe("TEST NFS SERVER CONFIGURATION", func() {
8485
Name: provisioner.CustomServerConfig,
8586
Value: scExportConfig,
8687
},
88+
{
89+
Name: provisioner.KeyPVBackendStorageClass,
90+
Value: backendSCName,
91+
},
8792
}
8893

8994
casObjStr, err := yaml.Marshal(casObj)

0 commit comments

Comments
 (0)