Skip to content

Commit

Permalink
Use medyagh/setup-minikube for github CI
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <bala@minio.io>
  • Loading branch information
balamurugana committed May 26, 2023
1 parent e4b1c56 commit 0c25238
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 7 deletions.
File renamed without changes.
13 changes: 6 additions & 7 deletions .github/workflows/functests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
kube-version: ['v1.18.20', 'v1.19.16', 'v1.20.15', 'v1.21.14', 'v1.22.16', 'v1.23.14', 'v1.24.8', 'v1.25.4']
kube-version: ['v1.18.20', 'v1.19.16', 'v1.20.15', 'v1.21.14', 'v1.22.17', 'v1.23.17', 'v1.24.14', 'v1.25.10', 'v1.26.3']
os: [ubuntu-20.04, ubuntu-22.04]
exclude:
- os: ubuntu-22.04
Expand Down Expand Up @@ -57,12 +57,11 @@ jobs:
docker build --quiet -t quay.io/minio/directpv:${VERSION} .
docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests
- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.7.2
- name: Start minikube
uses: medyagh/setup-minikube@latest
with:
minikube version: 'v1.28.0'
kubernetes version: ${{ matrix.kube-version }}
github token: ${{ secrets.GITHUB_TOKEN }}
driver: none
kubernetes-version: ${{ matrix.kube-version }}

- name: Check Minikube
run: |
Expand All @@ -81,7 +80,7 @@ jobs:
functests/run-migration-tests.sh "v3.2.2"
- name: Run migration tests with DirectCSI v2.0.9
if: contains(fromJson('["v1.18.20", "v1.19.16", "v1.20.15", "v1.21.14", "v1.22.16"]'), matrix.kube-version)
if: contains(fromJson('["v1.18.20", "v1.19.16", "v1.20.15", "v1.21.14", "v1.22.17"]'), matrix.kube-version)
run: |
sudo rm -fr /var/lib/directpv /var/lib/direct-csi
functests/run-migration-tests.sh "v2.0.9"
87 changes: 87 additions & 0 deletions .github/workflows/functests.yml.orig
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Functional Tests

on:
push:
branches: [ master, devel ]

pull_request:
branches: [ master, devel ]

# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
build:
name: Testing on Kubernetes ${{ matrix.kube-version }} in ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
kube-version: ['v1.18.20', 'v1.19.16', 'v1.20.15', 'v1.21.14', 'v1.22.16', 'v1.23.14', 'v1.24.8', 'v1.25.4']
os: [ubuntu-20.04, ubuntu-22.04]
exclude:
- os: ubuntu-22.04
kube-version: 'v1.18.20'

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20.x
check-latest: true

- name: Install dependencies
run: |
sudo apt-get update

- name: Set environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
mkdir -p "$(go env GOPATH)/src/github.com/minio/"
ln -s "$PWD" "$(go env GOPATH)/src/github.com/minio/directpv"
echo "VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV

- name: Build binaries
env:
CGO_ENABLED: 0
GO111MODULE: on
run: |
go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/directpv
go build -tags "osusergo netgo static_build" -ldflags="-X main.Version=${VERSION} -extldflags=-static" github.com/minio/directpv/cmd/kubectl-directpv

- name: Build docker image
run: |
docker build --quiet -t quay.io/minio/directpv:${VERSION} .
docker build --quiet -t example.org/test/sleep:v0.0.1 -f functests/Dockerfile.sleep functests

- name: Setup Minikube
uses: manusa/actions-setup-minikube@v2.7.2
with:
minikube version: 'v1.28.0'
kubernetes version: ${{ matrix.kube-version }}
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Minikube
run: |
kubectl get nodes
kubectl get pods -A
while kubectl get pods -n kube-system --no-headers | grep -vqw Running; do echo "Waiting for Minikube pods to be ready"; sleep 3; done
while kubectl get nodes --no-headers | grep -vqw Ready; do echo "Waiting for Minikube node to be ready"; sleep 3; done

- name: Run tests
run: |
functests/run-tests.sh

- name: Run migration tests with DirectCSI v3.2.2
run: |
sudo rm -fr /var/lib/directpv
functests/run-migration-tests.sh "v3.2.2"

- name: Run migration tests with DirectCSI v2.0.9
if: contains(fromJson('["v1.18.20", "v1.19.16", "v1.20.15", "v1.21.14", "v1.22.16"]'), matrix.kube-version)
run: |
sudo rm -fr /var/lib/directpv /var/lib/direct-csi
functests/run-migration-tests.sh "v2.0.9"

0 comments on commit 0c25238

Please sign in to comment.