Skip to content

Add functional tests #26

Add functional tests

Add functional tests #26

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: init directories
run: mkdir -p "$(pwd)/bin"
- name: Download kubebuilder
run: |
version=1.0.8
arch=amd64
curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_darwin_${arch}.tar.gz"
tar -zxvf kubebuilder_${version}_darwin_${arch}.tar.gz
mv kubebuilder_${version}_darwin_${arch} kubebuilder
echo "kubebuilder_${version}_darwin_${arch} renamed to kubebuilder"
sudo mv kubebuilder /usr/local/
echo "kubebuilder moved to /usr/local/ path"
if [ -d "/usr/local/kubebuilder" ]; then
echo "$DIRECTORY /usr/local/kubebuilder does exist."
else
echo "$DIRECTORY /usr/local/kubebuilder does not exist."
fi
export PATH=$PATH:/usr/local/kubebuilder/bin
- name: Set up Kubebuilder and setup-envtest
run: |
make envtest
echo "Kubebuilder-envtest : $(./bin/setup-envtest use 1.23 -p path)"
echo "KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.23 -p path)" >> $GITHUB_ENV
echo "USE_EXISTING_CLUSTER=false" >> $GITHUB_ENV
export KUBEBUILDER_ASSETS="$(./bin/setup-envtest use 1.23 -p path)"
export USE_EXISTING_CLUSTER=false
- name: Test
run: |
pwd
echo "KUBEBUILDER_ASSETS : $KUBEBUILDER_ASSETS"
echo "USE_EXISTING_CLUSTER : $USE_EXISTING_CLUSTER"
go test -v ./functional-tests