diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 000000000..0a3ec7a0f --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,25 @@ +name: Go +on: [push] +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.14 + uses: actions/setup-go@v1 + with: + go-version: 1.14 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - 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 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 000000000..0f9dded95 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,28 @@ +name: goreleaser + +on: + pull_request: + push: + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Unshallow + run: git fetch --prune --unshallow + + - name: Set up Go 1.14 + uses: actions/setup-go@v1 + with: + go-version: 1.14 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1.3.1 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/snyk.yml b/.github/workflows/snyk.yml new file mode 100644 index 000000000..5e1a6bbe1 --- /dev/null +++ b/.github/workflows/snyk.yml @@ -0,0 +1,14 @@ +name: Snyk +on: [pull_request] +jobs: + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/golang@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --org=auth0-extensibility --project-name=auth0-cli + command: monitor diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..e302753fc --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +#!/usr/bin/env make + +test: + CGO_ENABLED=1 go test -race ./... -count 1 + +lint: + golangci-lint run -v --timeout=5m + +.PHONY: test lint