diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e628f251..70cb668da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make provider-tf-azure.vendor vendor.check # Go version coming with golangci-lint-action may not be our desired # go version. We deploy our desired go version and then skip go @@ -82,6 +82,7 @@ jobs: with: version: ${{ env.GOLANGCI_VERSION }} skip-go-installation: true + args: --timeout 10m --skip-files internal/controller/zz_setup.go --skip-files internal/controller/config/config.go --skip-files cmd/provider/main.go check-diff: runs-on: ubuntu-18.04 @@ -99,6 +100,9 @@ jobs: with: go-version: ${{ env.GO_VERSION }} + - name: Install goimports + run: cd /tmp/ && go get golang.org/x/tools/cmd/goimports + - name: Find the Go Build Cache id: go run: echo "::set-output name=cache::$(go env GOCACHE)" @@ -118,7 +122,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make provider-tf-azure.vendor vendor.check - name: Check Diff run: make check-diff @@ -161,7 +165,7 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make provider-tf-azure.vendor vendor.check - name: Run Unit Tests run: make -j2 test @@ -222,7 +226,7 @@ jobs: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make provider-tf-azure.vendor vendor.check - name: Build Helm Chart run: make -j2 build @@ -283,10 +287,10 @@ jobs: restore-keys: ${{ runner.os }}-pkg- - name: Vendor Dependencies - run: make vendor vendor.check + run: make provider-tf-azure.vendor vendor.check - name: Build Artifacts - run: make -j2 build.all + run: make build.all env: # We're using docker buildx, which doesn't actually load the images it # builds by default. Specifying --load does so. diff --git a/.golangci.yml b/.golangci.yml index ebeba478d..abb26f122 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - deadline: 2m + deadline: 10m skip-files: - "zz_generated\\..+\\.go$" diff --git a/Makefile b/Makefile index 6f1593454..f91e1ea8f 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ reviewable: prepare.azurerm test: prepare.azurerm generate: codegen.pipeline build: prepare.azurerm - +provider-tf-azure.vendor: prepare.azurerm vendor # must match Docker build file env. variable TERRAFORM_PROVIDER_AZURERM_VERSION in # cluster/images/provider-tf-azure-controller/Dockerfile diff --git a/cmd/generator/main.go b/cmd/generator/main.go index b21d453e4..80377daaf 100644 --- a/cmd/generator/main.go +++ b/cmd/generator/main.go @@ -201,11 +201,11 @@ func main() { // nolint:gocyclo if err := pipeline.NewSetupGenerator(wd, modulePath).Generate(controllerPkgList); err != nil { panic(errors.Wrap(err, "cannot generate setup file")) } - if err := exec.Command("bash", "-c", "goimports -w $(find apis -iname 'zz_*')").Run(); err != nil { - panic(errors.Wrap(err, "cannot run goimports for apis folder")) + if out, err := exec.Command("bash", "-c", "goimports -w $(find apis -iname 'zz_*')").CombinedOutput(); err != nil { + panic(errors.Wrap(err, "cannot run goimports for apis folder: "+string(out))) } - if err := exec.Command("bash", "-c", "goimports -w $(find internal -iname 'zz_*')").Run(); err != nil { - panic(errors.Wrap(err, "cannot run goimports for internal folder")) + if out, err := exec.Command("bash", "-c", "goimports -w $(find internal -iname 'zz_*')").CombinedOutput(); err != nil { + panic(errors.Wrap(err, "cannot run goimports for internal folder: "+string(out))) } fmt.Printf("\nGenerated %d resources!\n", count) }