diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 0000000..0d0231f --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -0,0 +1,37 @@ +name: Go +on: [pull_request] +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Get kubebuilder + run: | + version=1.0.8 # latest stable version + arch=amd64 + + # download the release + curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_darwin_${arch}.tar.gz" + + # extract the archive + tar -zxvf kubebuilder_${version}_darwin_${arch}.tar.gz + mv kubebuilder_${version}_darwin_${arch} kubebuilder && sudo mv kubebuilder /usr/local/ + + # update your PATH to include /usr/local/kubebuilder/bin + export PATH=$PATH:/usr/local/kubebuilder/bin + + - name: Run tests + run: | + export GOPATH=$(go env GOPATH) + make test