Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
Signed-off-by: Ayush Sharma <[email protected]>
  • Loading branch information
ayushthe1 authored Mar 21, 2023
2 parents bef041c + 09d6b76 commit 6eb9977
Show file tree
Hide file tree
Showing 9 changed files with 421 additions and 311 deletions.
250 changes: 108 additions & 142 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,142 +1,108 @@
name: Default Meshery Linkerd Workflow
on:
push:
branches:
- "*"
tags:
- "v*"
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches:
- master

jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
error_check:
name: Error check
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go install github.com/kisielk/errcheck@latest; /home/runner/go/bin/errcheck -tags draft ./...
error_code_check:
name: Error code utility check
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- run: |
errWillHave="level=error"
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go install github.com/layer5io/meshkit/cmd/errorutil;
err=$(/home/runner/go/bin/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers);
echo "ERR: $err";
if [[ $err == *"$errWillHave"* ]];
then
echo "$err";
return 1;
fi
static_check:
name: Static check
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: dominikh/[email protected]
with:
install-go: false
version: "2022.1"
vet:
name: Vet
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
sec_check:
name: Security check
runs-on: ubuntu-22.04
env:
GO111MODULE: on
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: -exclude=G301,G304,G107,G101,G110,G204,G409,G305,G302 ./...
tests:
# needs: [lint, error_check, static_check, vet, sec_check]
name: Tests
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Create cluster using KinD
uses: engineerd/[email protected]
with:
version: "v0.11.0"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
export KUBECONFIG="${HOME}/.kube/config"
echo "environment-kubeconfig:" ${KUBECONFIG}
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go test -v ./...
name: Default Meshery Linkerd Workflow

on:
push:
branches:
- '*'
tags:
- 'v*'
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches:
- master

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'

- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run Linters
uses: golangci/golangci-lint-action@v3
with:
args: --timeout 3m --verbose
error_code_check:
name: Error code utility check
runs-on: ubuntu-22.04
steps:

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'

- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- run: |
errWillHave="level=error"
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go install github.com/layer5io/meshkit/cmd/errorutil;
err=$(/home/runner/go/bin/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers);
echo "ERR: $err";
if [[ $err == *"$errWillHave"* ]];
then
echo "$err";
return 1;
fi
tests:
name: Tests
runs-on: ubuntu-22.04
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'

- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Create cluster using KinD
uses: engineerd/[email protected]
with:
version: "v0.11.0"
- run: |
export CURRENTCONTEXT="$(kubectl config current-context)"
echo "current-context:" ${CURRENTCONTEXT}
export KUBECONFIG="${HOME}/.kube/config"
echo "environment-kubeconfig:" ${KUBECONFIG}
GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go test -v ./...
Loading

0 comments on commit 6eb9977

Please sign in to comment.