Skip to content

Commit

Permalink
chore(actions): move travis tests to github actions (#223)
Browse files Browse the repository at this point in the history

Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai authored Jan 8, 2021
1 parent 32b9453 commit 4d9034f
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 54 deletions.
67 changes: 62 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,66 @@ jobs:
pattern: '*.sh'
exclude: './.git/*,./vendor/*'

unit-tests:
name: unit tests
runs-on: ubuntu-latest
steps:

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

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: verify license
run: make license-check

- name: verify dependencies
run: make deps

- name: verify tests
run: make test

e2e-tests:
needs: ['unit-tests']
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetes: [v1.18.6]
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Set tag
run: |
BRANCH="${GITHUB_REF##*/}"
CI_TAG=${BRANCH#v}-ci
if [ ${BRANCH} = "master" ]; then
CI_TAG="ci"
fi
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Build images locally
run: make all.amd64 || exit 1;

- name: Running tests
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh

cspc-operator:
runs-on: ubuntu-latest
needs: ['lint']
needs: ['lint', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -79,7 +136,7 @@ jobs:
cvc-operator:
runs-on: ubuntu-latest
needs: ['lint']
needs: ['lint', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -125,7 +182,7 @@ jobs:
pool-manager:
runs-on: ubuntu-latest
needs: ['lint']
needs: ['lint', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -171,7 +228,7 @@ jobs:
volume-manager:
runs-on: ubuntu-latest
needs: ['lint']
needs: ['lint', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -217,7 +274,7 @@ jobs:
cstor-webhook:
runs-on: ubuntu-latest
needs: ['lint']
needs: ['lint', 'e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/go.yml

This file was deleted.

56 changes: 55 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
path: '.'
pattern: '*.sh'
exclude: './vendor/*'

cspc-operator:
runs-on: ubuntu-latest
needs: ['lint']
Expand Down Expand Up @@ -151,3 +151,57 @@ jobs:
env:
IMG_RESULT: cache
run: make docker.buildx.cstor-webhook

unit-tests:
name: unit tests
runs-on: ubuntu-latest
steps:

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

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: verify license
run: make license-check

- name: verify dependencies
run: make deps

- name: verify tests
run: make test

e2e-tests:
needs: ['unit-tests']
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetes: [v1.18.6]
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Set tag
run: |
BRANCH="${GITHUB_REF##*/}"
CI_TAG="ci"
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Build images locally
run: make all.amd64 || exit 1;

- name: Running tests
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,62 @@ on:
- 'v*'

jobs:
unit-tests:
name: unit tests
runs-on: ubuntu-latest
steps:

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

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: verify license
run: make license-check

- name: verify dependencies
run: make deps

- name: verify tests
run: make test

e2e-tests:
needs: ['unit-tests']
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kubernetes: [v1.18.6]
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Set Tag
run: |
TAG="${GITHUB_REF#refs/*/v}"
echo "TAG=${TAG}" >> $GITHUB_ENV
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
- name: Build images locally
run: make all.amd64 || exit 1;

- name: Running tests
run: ./ci/sanity/install.sh && ./ci/sanity/sanity.sh

cspc-operator:
runs-on: ubuntu-latest
needs: ['e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down Expand Up @@ -61,6 +115,7 @@ jobs:
cvc-operator:
runs-on: ubuntu-latest
needs: ['e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down Expand Up @@ -101,6 +156,7 @@ jobs:
pool-manager:
runs-on: ubuntu-latest
needs: ['e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down Expand Up @@ -141,6 +197,7 @@ jobs:
volume-manager:
runs-on: ubuntu-latest
needs: ['e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down Expand Up @@ -181,6 +238,7 @@ jobs:
cstor-webhook:
runs-on: ubuntu-latest
needs: ['e2e-tests']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion ci/sanity/sanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function getBD(){
nodeName=$1
BD_RETRY=$2
for i in $(seq 1 $BD_RETRY) ; do
bdName=$(kubectl get bd -n openebs -l kubernetes.io/hostname=$nodeName -o=jsonpath={.items[0].metadata.name})
bdName=$(kubectl get bd -n openebs -l kubernetes.io/hostname="$nodeName" -o=jsonpath='{.items[1].metadata.name}')
if [ "$bdName" != "" ]; then
echo "Got BD $bdName"
break
Expand Down

0 comments on commit 4d9034f

Please sign in to comment.