Skip to content

Commit

Permalink
stable
Browse files Browse the repository at this point in the history
Signed-off-by: leecalcote <[email protected]>
  • Loading branch information
leecalcote committed Jul 4, 2020
1 parent e49888b commit e3117e9
Showing 1 changed file with 105 additions and 45 deletions.
150 changes: 105 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit e3117e9

Please sign in to comment.