Skip to content

Commit 3d53565

Browse files
authored
feat(action): migrating to github action from travis (#27)
* move bdd test cases to github action * remove travis file and move ansible to github * set the default image org as openebs Signed-off-by: Pawan <[email protected]>
1 parent a7c1102 commit 3d53565

File tree

5 files changed

+102
-63
lines changed

5 files changed

+102
-63
lines changed

.github/workflows/build.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,70 @@ jobs:
4444
- name: Upload Coverage Report
4545
uses: codecov/codecov-action@v1
4646

47+
bdd-test:
48+
needs: ['unit-test']
49+
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: true
52+
matrix:
53+
kubernetes: [v1.20.1]
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v2
57+
58+
- name: Set up Go 1.14
59+
uses: actions/setup-go@v2
60+
with:
61+
go-version: 1.14.7
62+
63+
- name: Setup Minikube-Kubernetes
64+
uses: manusa/[email protected]
65+
with:
66+
minikube version: v1.16.0
67+
kubernetes version: ${{ matrix.kubernetes }}
68+
github token: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build images locally
71+
run: make lvm-driver-image || exit 1;
72+
73+
- name: bootstrap
74+
run: make bootstrap
75+
76+
- name: Running tests
77+
run: ./ci/ci-test.sh
78+
79+
ansible:
80+
runs-on: ubuntu-latest
81+
needs: ['lint', 'unit-test', 'bdd-test']
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v2
85+
86+
- name: Set Image Org
87+
# sets the default IMAGE_ORG to openebs
88+
run: |
89+
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
90+
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
91+
92+
- name: Login to Docker Hub
93+
uses: docker/login-action@v1
94+
with:
95+
username: ${{ secrets.DOCKERHUB_USERNAME }}
96+
password: ${{ secrets.DOCKERHUB_TOKEN }}
97+
98+
- name: Build and push the ansible image
99+
uses: docker/build-push-action@v2
100+
with:
101+
file: ./e2e-tests/Dockerfile
102+
push: true
103+
load: false
104+
platforms: linux/amd64
105+
tags: |
106+
${{ env.IMAGE_ORG }}/lvm-localpv-e2e:ci
107+
47108
csi-driver:
48109
runs-on: ubuntu-latest
49-
needs: ['lint', 'unit-test']
110+
needs: ['lint', 'unit-test', 'bdd-test']
50111
steps:
51112
- name: Checkout
52113
uses: actions/checkout@v2

.github/workflows/pull_request.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,41 @@ jobs:
5656
- name: Upload Coverage Report
5757
uses: codecov/codecov-action@v1
5858

59+
bdd-test:
60+
needs: ['unit-test']
61+
runs-on: ubuntu-latest
62+
strategy:
63+
fail-fast: true
64+
matrix:
65+
kubernetes: [v1.20.1]
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
69+
70+
- name: Set up Go 1.14
71+
uses: actions/setup-go@v2
72+
with:
73+
go-version: 1.14.7
74+
75+
- name: Setup Minikube-Kubernetes
76+
uses: manusa/[email protected]
77+
with:
78+
minikube version: v1.16.0
79+
kubernetes version: ${{ matrix.kubernetes }}
80+
github token: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- name: Build images locally
83+
run: make lvm-driver-image || exit 1;
84+
85+
- name: bootstrap
86+
run: make bootstrap
87+
88+
- name: Running tests
89+
run: ./ci/ci-test.sh
5990

6091
csi-driver:
6192
runs-on: ubuntu-latest
62-
needs: ['lint', 'unit-test']
93+
needs: ['lint', 'unit-test', 'bdd-test']
6394
steps:
6495
- name: Checkout
6596
uses: actions/checkout@v2

.travis.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
move the bdd test cases to github action

ci/ci-test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@ set -e
1818

1919
# setup the lvm volume group to create the volume
2020
truncate -s 1024G /tmp/disk.img
21-
disk=`losetup -f /tmp/disk.img --show`
22-
pvcreate "$disk"
23-
vgcreate lvmvg "$disk"
21+
disk=`sudo losetup -f /tmp/disk.img --show`
22+
sudo pvcreate "$disk"
23+
sudo vgcreate lvmvg "$disk"
24+
25+
# install snapshot module for lvm
26+
sudo modprobe dm-snapshot
2427

2528
LVM_OPERATOR=deploy/lvm-operator.yaml
2629
SNAP_CLASS=deploy/sample/lvmsnapclass.yaml
2730

2831
export LVM_NAMESPACE="openebs"
2932
export TEST_DIR="tests"
3033
export NAMESPACE="kube-system"
34+
export KUBECONFIG=$HOME/.kube/config
3135

3236
# Prepare env for running BDD tests
3337
# Minikube is already running

0 commit comments

Comments
 (0)