Skip to content

Commit

Permalink
feat(action): migrating to github action from travis (#27)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
pawanpraka1 authored Mar 4, 2021
1 parent a7c1102 commit 3d53565
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 63 deletions.
63 changes: 62 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,70 @@ jobs:
- name: Upload Coverage Report
uses: codecov/codecov-action@v1

bdd-test:
needs: ['unit-test']
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
kubernetes: [v1.20.1]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: 1.14.7

- name: Setup Minikube-Kubernetes
uses: manusa/[email protected]
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Build images locally
run: make lvm-driver-image || exit 1;

- name: bootstrap
run: make bootstrap

- name: Running tests
run: ./ci/ci-test.sh

ansible:
runs-on: ubuntu-latest
needs: ['lint', 'unit-test', 'bdd-test']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push the ansible image
uses: docker/build-push-action@v2
with:
file: ./e2e-tests/Dockerfile
push: true
load: false
platforms: linux/amd64
tags: |
${{ env.IMAGE_ORG }}/lvm-localpv-e2e:ci
csi-driver:
runs-on: ubuntu-latest
needs: ['lint', 'unit-test']
needs: ['lint', 'unit-test', 'bdd-test']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,41 @@ jobs:
- name: Upload Coverage Report
uses: codecov/codecov-action@v1

bdd-test:
needs: ['unit-test']
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
kubernetes: [v1.20.1]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: 1.14.7

- name: Setup Minikube-Kubernetes
uses: manusa/[email protected]
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Build images locally
run: make lvm-driver-image || exit 1;

- name: bootstrap
run: make bootstrap

- name: Running tests
run: ./ci/ci-test.sh

csi-driver:
runs-on: ubuntu-latest
needs: ['lint', 'unit-test']
needs: ['lint', 'unit-test', 'bdd-test']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
58 changes: 0 additions & 58 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions changelogs/unreleased/27-pawanpraka1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
move the bdd test cases to github action
10 changes: 7 additions & 3 deletions ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ set -e

# setup the lvm volume group to create the volume
truncate -s 1024G /tmp/disk.img
disk=`losetup -f /tmp/disk.img --show`
pvcreate "$disk"
vgcreate lvmvg "$disk"
disk=`sudo losetup -f /tmp/disk.img --show`
sudo pvcreate "$disk"
sudo vgcreate lvmvg "$disk"

# install snapshot module for lvm
sudo modprobe dm-snapshot

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

export LVM_NAMESPACE="openebs"
export TEST_DIR="tests"
export NAMESPACE="kube-system"
export KUBECONFIG=$HOME/.kube/config

# Prepare env for running BDD tests
# Minikube is already running
Expand Down

0 comments on commit 3d53565

Please sign in to comment.