diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..dd5d045c9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI Workflow +on: + # Run this workflow every time a new commit pushed to upstream/fork repository. + # Run workflow on fork repository will help contributors find and resolve issues before sending a PR. + push: + pull_request: +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # the version of golangci-lint. + version: v1.32.2 + + # show only new issues if it's a pull request. + only-new-issues: false + codegen: + name: codegen, crdgen + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: 1.14.x + - name: verify codegen + run: hack/verify-codegen.sh + - name: verify crdgen + run: hack/verify-crdgen.sh + build: + name: compile binary and images + needs: codegen # rely on codegen successful completion + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: 1.14.x + - name: compile + run: make all + - name: make images + run: make images + diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 6366c04c8..000000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: golangci-lint -on: - # Run this workflow every time a new commit pushed to upstream/fork repository. - # Run workflow on fork repository will help contributors find and resolve issues before sending a PR. - push: - pull_request: -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - # the version of golangci-lint. - version: v1.32.2 - - # show only new issues if it's a pull request. - only-new-issues: false diff --git a/hack/update-crdgen.sh b/hack/update-crdgen.sh index b046ddd73..f476e49e6 100755 --- a/hack/update-crdgen.sh +++ b/hack/update-crdgen.sh @@ -4,4 +4,13 @@ set -o errexit set -o nounset set -o pipefail +CONTROLLER_GEN_VERSION="v0.4.1" + +# Install tools we need. +TEMP_PATH=$(mktemp -d) +pushd "${TEMP_PATH}" >/dev/null + GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/controller-gen@"${CONTROLLER_GEN_VERSION}" +popd >/dev/null +rm -rf "${TEMP_PATH}" + controller-gen crd paths=./pkg/apis/... output:crd:dir=./artifacts/deploy