-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use medyagh/setup-minikube for github CI
Signed-off-by: Bala.FA <bala@minio.io>
- Loading branch information
1 parent
e4b1c56
commit 0c25238
Showing
3 changed files
with
93 additions
and
7 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |