Add functional tests #4
Workflow file for this run
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 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 setup-envtest binary file | |
run: curl -L -o "$(pwd)/bin/setup-envtest" https://github.com/kubernetes-sigs/kubebuilder/releases/download/v1.22.1/setup-envtest | |
- 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 | |
sudo mv kubebuilder /usr/local/ | |
export PATH=$PATH:/usr/local/kubebuilder/bin | |
- name: Set up Kubebuilder and setup-envtest | |
run: export KUBEBUILDER_ASSETS="$($GOROOT/bin/setup-envtest use 1.23 -p path)" USE_EXISTING_CLUSTER=false | |
- name: Test | |
run: go test -v ./functional-tests |