-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updated version of go and github actions
Signed-off-by: Abhiuday <[email protected]>
- Loading branch information
Showing
12 changed files
with
341 additions
and
311 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 |
---|---|---|
|
@@ -6,62 +6,62 @@ on: | |
branches: | ||
- "master" | ||
paths-ignore: | ||
- '.github/**' | ||
- ".github/**" | ||
|
||
jobs: | ||
build: | ||
name: Build check | ||
runs-on: ubuntu-22.04 | ||
# needs: [lint, error_check, static_check, vet, sec_check, tests] | ||
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=direct GOSUMDB=off GO111MODULE=on go build . | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build . | ||
docker: | ||
name: Docker build and push | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Docker login | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker edge build & tag | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" . | ||
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker edge push | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker stable build & tag | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} . | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker stable push | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker Hub Description | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: peter-evans/[email protected] | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Docker login | ||
uses: azure/docker-login@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Docker edge build & tag | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:edge-latest --build-arg TOKEN=${{ secrets.GLOBAL_TOKEN }} --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION="edge-latest" . | ||
docker tag ${{ secrets.IMAGE_NAME }}:edge-latest ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker edge push | ||
if: startsWith(github.ref, 'refs/tags/') != true && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:edge-${GITHUB_SHA::7} | ||
- name: Docker stable build & tag | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
DOCKER_BUILDKIT=1 docker build --no-cache -t ${{ secrets.IMAGE_NAME }}:stable-latest --build-arg GIT_COMMITSHA=${GITHUB_SHA::7} --build-arg VERSION=${GITHUB_REF/refs\/tags\//} . | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker tag ${{ secrets.IMAGE_NAME }}:stable-latest ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker stable push | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
run: | | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-latest | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_REF/refs\/tags\//} | ||
docker push ${{ secrets.IMAGE_NAME }}:stable-${GITHUB_SHA::7} | ||
- name: Docker Hub Description | ||
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() | ||
uses: peter-evans/[email protected] | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKERHUB_REPOSITORY: ${{ secrets.IMAGE_NAME }} |
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 |
---|---|---|
|
@@ -6,8 +6,8 @@ on: | |
tags: | ||
- "v*" | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.github/**' | ||
- "docs/**" | ||
- ".github/**" | ||
pull_request: | ||
branches: | ||
- master | ||
|
@@ -16,15 +16,15 @@ jobs: | |
name: golangci-lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
go-version: 1.21 | ||
- uses: actions/checkout@v4 | ||
- 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 | ||
version: v1.54 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# working-directory: somedir | ||
|
@@ -39,65 +39,65 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- 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 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- 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 | ||
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 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
- uses: dominikh/staticcheck-action@v1.2.0 | ||
go-version: 1.21 | ||
- uses: dominikh/staticcheck-action@v1.3.0 | ||
with: | ||
install-go: false | ||
version: "2022.1" | ||
version: "2023.1.6" | ||
vet: | ||
name: Vet | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.19 | ||
go-version: 1.21 | ||
- run: GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./... | ||
sec_check: | ||
name: Security check | ||
|
@@ -106,36 +106,35 @@ jobs: | |
GO111MODULE: on | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
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 ./... | ||
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: Tests | ||
runs-on: ubuntu-22.04 | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21 | ||
- name: Create cluster using KinD | ||
uses: engineerd/[email protected] | ||
with: | ||
version: "v0.11.1" | ||
- 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 ./... |
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
Oops, something went wrong.