From 6217565c89fc7d3431db8c308a2be2bb5941ba3f Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Sun, 9 Oct 2022 11:48:59 +0300 Subject: [PATCH] add go vet and go lint Signed-off-by: Avi Deitcher --- .github/workflows/ci.yml | 54 ++++++++++++---------------------- .github/workflows/publish.yaml | 4 +-- .github/workflows/release.yml | 10 +++---- 3 files changed, 23 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee3aeb64b..589712de3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,35 +35,29 @@ jobs: runs-on: ${{ matrix.target.runner }} steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v2 + - name: Set up Go 1.19 + uses: actions/setup-go@v3 with: - go-version: 1.16.7 + go-version: 1.19.2 id: go - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Set path run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH env: GOPATH: ${{runner.workspace}} - - name: Get pre-requisites + - name: golangci-lint CLI + uses: golangci/golangci-lint-action@v3 + with: + version: v1.50.0 + working-directory: src/cmd/linuxkit + args: --verbose --timeout=10m + - name: go vet CLI run: | - go get -u golang.org/x/lint/golint - go get -u github.com/gordonklaus/ineffassign - env: - GOPATH: ${{runner.workspace}} - - # - name: Lint - # run: | - # make local-check - # env: - # GOPATH: ${{runner.workspace}} - + cd src/cmd/linuxkit && go vet ./... - name: Build run: | make GOARCH=${{matrix.target.arch}} GOOS=${{matrix.target.os}} LOCAL_TARGET=$(pwd)/bin/linuxkit-${{matrix.target.suffix}} local-build @@ -99,9 +93,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Set up binfmt # Only register arm64 as we are on amd64 already. s390x is not reliable @@ -138,9 +130,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Install Pre-Requisites run: | @@ -194,9 +184,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Install Pre-Requisites run: | @@ -242,9 +230,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Install Pre-Requisites run: | @@ -290,9 +276,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Install Pre-Requisites run: | @@ -338,9 +322,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Install Pre-Requisites run: | diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8717f551d..dce5d9913 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,9 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Ensure bin/ directory run: mkdir -p bin - name: Download linuxkit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f20783c9..edcfffdce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,16 +11,14 @@ jobs: runs-on: macos-latest steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v2 + - name: Set up Go 1.19 + uses: actions/setup-go@v3 with: - go-version: 1.16.7 + go-version: 1.19.2 id: go - name: Check out code - uses: actions/checkout@v1 - with: - path: ./src/github.com/linuxkit/linuxkit + uses: actions/checkout@v3 - name: Set path run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH