diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index eb3cbbb2e..7f83dfa02 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -22,3 +22,16 @@ jobs: - name: ci run: PATH=$(go env GOPATH)/bin:$PATH make ci + + - name: integration + # skip running this action if the PR is coming from a fork: + if: github.event.pull_request.head.repo.full_name == github.repository + shell: bash + run: PATH=$(go env GOPATH)/bin:$PATH make integration + env: + AUTH0_CLI_CLIENT_NAME: ${{ secrets.AUTH0_CLI_CLIENT_NAME }} + AUTH0_CLI_CLIENT_DOMAIN: ${{ secrets.AUTH0_CLI_CLIENT_DOMAIN }} + AUTH0_CLI_CLIENT_ID: ${{ secrets.AUTH0_CLI_CLIENT_ID }} + AUTH0_CLI_CLIENT_SECRET: ${{ secrets.AUTH0_CLI_CLIENT_SECRET }} + AUTH0_CLI_REUSE_CONFIG: ${{ secrets.AUTH0_CLI_REUSE_CONFIG }} + AUTH0_CLI_OVERWRITE: ${{ secrets.AUTH0_CLI_OVERWRITE }} diff --git a/Makefile b/Makefile index d65c8b1c5..a70e37b1d 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,7 @@ lint: # Build for the native platform build: - go build -ldflags "$(CTIMEVAR)" -o auth0 cmd/auth0/main.go -.PHONY: build - -# Build for the native platform -build: + go build -ldflags "$(CTIMEVAR)" -o $(GOBIN)/auth0 cmd/auth0/main.go .PHONY: build # Build a beta version of auth0-cli for all supported platforms @@ -78,5 +74,9 @@ integration-cleanup: ./integration/test-cleanup.sh .PHONY: integration-cleanup -integration: $(GOBIN)/auth0-cli-config-generator $(GOBIN)/commander run-integration integration-cleanup +integration: build $(GOBIN)/auth0-cli-config-generator $(GOBIN)/commander + $(MAKE) run-integration; \ + ret=$$?; \ + $(MAKE) integration-cleanup; \ + exit $$ret .PHONY: integration diff --git a/integration/test-cleanup.sh b/integration/test-cleanup.sh index df36daf1d..691f62829 100755 --- a/integration/test-cleanup.sh +++ b/integration/test-cleanup.sh @@ -9,7 +9,8 @@ for app in $( echo "${apps}" | jq -r '.[] | @base64' ); do clientid=$(_jq '.ClientID') name=$(_jq '.Name') - + # TODO(jfatta): should remove only those + # created during the same test session if [[ $name = integration-test-* ]] then echo deleting "$name" diff --git a/internal/cli/apps.go b/internal/cli/apps.go index bce1b9c50..c3ba11412 100644 --- a/internal/cli/apps.go +++ b/internal/cli/apps.go @@ -416,7 +416,7 @@ auth0 apps create -n myapp -t [native|spa|regular|m2m] --description