From 13a0e176e8ec70ee72d20b4b494ea7857208afe4 Mon Sep 17 00:00:00 2001 From: Cyril David Date: Tue, 1 Sep 2020 09:47:37 -0700 Subject: [PATCH] Add github CI --- .github/workflows/go.yml | 25 +++++++++++++++++++++++++ .github/workflows/goreleaser.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/snyk.yml | 14 ++++++++++++++ Makefile | 9 +++++++++ 4 files changed, 76 insertions(+) create mode 100644 .github/workflows/go.yml create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .github/workflows/snyk.yml create mode 100644 Makefile 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