Skip to content

Commit

Permalink
Merge pull request #167 from VaibhavMalik4187/go-version-update
Browse files Browse the repository at this point in the history
Updated the go version in github actions to 1.20
  • Loading branch information
Aisuko authored Aug 26, 2023
2 parents f7cfffb + fd773c1 commit 7d40142
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
GO_VERSION: '1.20'

name: Meshery NSM
on:
push:
Expand All @@ -14,14 +17,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
go-version: ${{ secrets.GO_VERSION }}
- 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
version: v1.52
args: --timeout=5m
error_check:
name: Error check
runs-on: ubuntu-latest
Expand All @@ -31,10 +38,10 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
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 ./...
go-version: ${{ env.GO_VERSION }}
- run: go install github.com/kisielk/errcheck@latest; errcheck -tags draft ./...
static_check:
name: Static check
runs-on: ubuntu-latest
Expand All @@ -44,10 +51,10 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: ${{ secrets.GO_VERSION }}
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go get -u honnef.co/go/tools/cmd/staticcheck; PKGS=$(go list ./... | grep -vF /meshes); /home/runner/go/bin/staticcheck -tags draft -checks all $PKGS # https://staticcheck.io/docs/checks
go-version: ${{ env.GO_VERSION }}
- run: go install honnef.co/go/tools/cmd/staticcheck@latest; PKGS=$(go list ./... | grep -vF /meshes); staticcheck -tags draft -checks all $PKGS # https://staticcheck.io/docs/checks
# vet:
# name: Vet
# runs-on: ubuntu-latest
Expand All @@ -59,7 +66,7 @@ jobs:
# - name: Setup Go
# uses: actions/setup-go@v1
# with:
# go-version: ${{ secrets.GO_VERSION }}
# go-version: ${{ env.GO_VERSION }}
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go vet -tags draft ./...
# sec_check:
# name: Security check
Expand All @@ -72,7 +79,7 @@ jobs:
# - name: Setup Go
# uses: actions/setup-go@v1
# with:
# go-version: ${{ secrets.GO_VERSION }}
# go-version: ${{ env.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]
Expand All @@ -86,7 +93,7 @@ jobs:
# - name: Setup Go
# uses: actions/setup-go@v1
# with:
# go-version: ${{ secrets.GO_VERSION }}
# go-version: ${{ env.GO_VERSION }}
# - run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go test -tags draft ./...
build:
name: Build check
Expand All @@ -98,7 +105,7 @@ jobs:
with:
fetch-depth: 1
- name: Setup Go
uses: actions/setup-go@v1
uses: actions/setup-go@v4
with:
go-version: ${{ secrets.GO_VERSION }}
- run: GOPROXY=direct GOSUMDB=off GO111MODULE=on go build .
go-version: ${{ env.GO_VERSION }}
- run: go build .
7 changes: 5 additions & 2 deletions .github/workflows/error-ref-publisher.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
env:
GO_VERSION: 1.20

name: Meshkit Error Codes Utility Runner
on:
push:
Expand All @@ -21,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ secrets.GO_VERSION }}
go-version: ${{ env.GO_VERSION }}

- name: Run utility
run: |
Expand Down Expand Up @@ -61,4 +64,4 @@ jobs:
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Docs] Error Code Reference: Meshery Adapter for for NSM updated'
file_pattern: docs/
file_pattern: docs/
4 changes: 2 additions & 2 deletions internal/config/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"regexp"
"sort"
Expand Down Expand Up @@ -76,7 +76,7 @@ func GetLatestReleases(releases uint) ([]*Release, error) {
return []*Release{}, ErrGetLatestReleases(fmt.Errorf("unexpected status code: %d", resp.StatusCode))
}

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return []*Release{}, ErrGetLatestReleases(err)
}
Expand Down

0 comments on commit 7d40142

Please sign in to comment.