Skip to content

Commit

Permalink
Merge pull request crossplane-contrib#67 from ulucinar/fix-ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
ulucinar authored Oct 15, 2021
2 parents 291f687 + 8d84767 commit 12d4d20
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
deadline: 2m
deadline: 10m

skip-files:
- "zz_generated\\..+\\.go$"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions cmd/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 12d4d20

Please sign in to comment.