Skip to content

Commit

Permalink
chore: addtional make targets for build and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shushen committed Jan 18, 2021
1 parent 22b3ba5 commit 8643085
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ jobs:
- name: Install golanglint-ci
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.23.6

- name: Lint
run: PATH=$(go env GOPATH)/bin:$PATH make lint

- name: Test
run: make test
- name: ci
run: PATH=$(go env GOPATH)/bin:$PATH make ci
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,28 @@

test:
CGO_ENABLED=1 go test -race ./... -count 1
.PHONY: test

lint:
golangci-lint run -v --timeout=5m
.PHONY: lint

.PHONY: test lint
# Build for the native platform
build:
go build -o auth0 cmd/auth0/main.go
.PHONY: build

# Build for the native platform
build:
.PHONY: build

# Build a beta version of stripe for all supported platforms
build-all-platforms:
env GOOS=darwin go build -o auth0-darwin cmd/auth0/main.go
env GOOS=linux go build -o auth0-linux cmd/auth0/main.go
env GOOS=windows go build -o auth0-windows.exe cmd/auth0/main.go
.PHONY: build-all-platforms

# Run all the tests and code checks
ci: build-all-platforms test lint
.PHONY: ci
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ Stripe CLI, etc.
## Setup instructions

1. [Setup go](https://golang.org/doc/install)
2. Clone this repo (git clone [email protected]:auth0/auth0-cli
2. Clone this repo: `git clone [email protected]:auth0/auth0-cli`
3. `make test` - ensure everything works correctly. Should see things pass.

## Build and run on native platform

From the top-level directory:
```
$ make build
$ ./auth0 --help
```

## Adding a new command

This part is not fully fleshed out yet, but here are the steps:
Expand All @@ -35,12 +43,12 @@ go run ./cmd/auth0 <your command>
If you have to add another go dependency, you can follow the steps:

1. `go get -u github.com/some/path/to/lib`
2. Import the library you need in the relevant file. (This step is necessary so
2. Import the library you need in the relevant file. (This step is necessary, so
the next steps informs `go mod` that this dependency is actually used).
3. go mod tidy
4. go mod vendor

We use vendoring so the last step is required.
We use vendoring, so the last step is required.

## References

Expand Down

0 comments on commit 8643085

Please sign in to comment.