-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: leecalcote <[email protected]>
- Loading branch information
1 parent
e49888b
commit e3117e9
Showing
1 changed file
with
105 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,14 @@ jobs: | |
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./linkerd/... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status | ||
error_check: | ||
name: Error check | ||
runs-on: ubuntu-latest | ||
|
@@ -34,7 +41,14 @@ jobs: | |
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -tags draft ./... | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u github.com/kisielk/errcheck; /home/runner/go/bin/errcheck -exclude errcheck_excludes.txt ./... | ||
static_check: | ||
name: Static check | ||
runs-on: ubuntu-latest | ||
|
@@ -47,51 +61,90 @@ jobs: | |
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -tags draft -checks all ./linkerd/... # https://staticcheck.io/docs/checks | ||
# vet: | ||
# name: Vet | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@master | ||
# with: | ||
# fetch-depth: 1 | ||
# - name: Setup Go | ||
# uses: actions/setup-go@v1 | ||
# with: | ||
# go-version: ${{ secrets.GO_VERSION }} | ||
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./... | ||
# sec_check: | ||
# name: Security check | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@master | ||
# with: | ||
# fetch-depth: 1 | ||
# - name: Setup Go | ||
# uses: actions/setup-go@v1 | ||
# with: | ||
# go-version: ${{ secrets.GO_VERSION }} | ||
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get github.com/securego/gosec/cmd/gosec; /home/runner/go/bin/gosec ./... # https://github.com/securego/gosec | ||
# tests: | ||
# # needs: [lint, error_check, static_check, vet, sec_check] | ||
# name: Tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@master | ||
# with: | ||
# fetch-depth: 1 | ||
# - name: Setup Go | ||
# uses: actions/setup-go@v1 | ||
# with: | ||
# go-version: ${{ secrets.GO_VERSION }} | ||
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go test -tags draft ./... | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; /home/runner/go/bin/staticcheck -checks all,-ST1000 ./... # https://staticcheck.io/docs/checks | ||
vet: | ||
name: Vet | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet ./... | ||
sec_check: | ||
name: Security check | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: ./... | ||
tests: | ||
needs: [lint, error_check, static_check, vet, sec_check] | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Create cluster using KinD | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "v0.7.0" | ||
- run: | | ||
export CURRENTCONTEXT="$(kubectl config current-context)" | ||
echo "current-context:" ${CURRENTCONTEXT} | ||
export KUBECONFIG="${HOME}/.kube/config" | ||
echo "environment-kubeconfig:" ${KUBECONFIG} | ||
GOPROXY=direct GOSUMDB=off GO111MODULE=on go test ./... | ||
build: | ||
name: Build check | ||
runs-on: ubuntu-latest | ||
# needs: [lint, error_check, static_check, vet, sec_check, tests] | ||
needs: [lint, error_check, static_check, vet, sec_check, tests] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
|
@@ -101,6 +154,13 @@ jobs: | |
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ secrets.GO_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build . | ||
docker: | ||
name: Docker build and push | ||
|
@@ -136,4 +196,4 @@ jobs: | |
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} |