Fix github workflows #775
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
name: CI | |
'on': | |
- push | |
- pull_request | |
env: | |
GOPROXY: https://proxy.golang.org | |
GOPATH: ${{ github.workspace }}/go | |
jobs: | |
verify-goimports: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- run: | | |
echo "GOPATH=${HOME}/go" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- name: verify goimports | |
run: | | |
files=$(go run golang.org/x/tools/cmd/goimports -format-only -l .) | |
# Sadly goimports doesn't use exit codes | |
if [[ -n "${files}" ]]; then | |
echo "::error ::goimports should be run on these files:" | |
echo "${files}" | |
exit 1 | |
fi | |
verify-gomod: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- run: | | |
echo "GOPATH=${HOME}/go" >> $GITHUB_ENV | |
- uses: actions/checkout@v3 | |
- run: go mod tidy | |
- run: | | |
changes=$(git status --porcelain) | |
if [[ -n "${changes}" ]]; then | |
echo "::error Changes detected from go mod tidy:" | |
echo "${changes}" | |
exit 1 | |
fi | |
kind-e2e: | |
name: Test with a Kind cluster | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Install latest version of Kind | |
run: | | |
GO111MODULE=on go get sigs.k8s.io/kind | |
- name: Create Kind cluster | |
run: | | |
PATH=$(go env GOPATH)/bin:$PATH kind create cluster --config .github/workflows/kind-config.yaml | |
- name: Run some sanity checks | |
# kubectl is already installed on the Github Ubuntu worker | |
run: | | |
kubectl get nodes -o wide | |
kubectl get pods --all-namespaces -o wide | |
kubectl get services --all-namespaces -o wide |