From c7b5a322eda63419e2dafa8dd215b08739ebe9f5 Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Tue, 25 Oct 2022 03:22:29 +0000 Subject: [PATCH] Update GitHub actions CI workflow Update GitHub Actions runner OS from Ubuntu 18.04 to Ubuntu 22.04. Update actions/setup-go from v2 to v3. Update Go compiler from Go 1.17 to Go 1.20. Update golangci-lint from v1.45.0 to v1.51.2 for Go 1.20 support. Remove deprecated `-i` flag from make coverage target. Signed-off-by: Austin Vazquez --- .github/workflows/ci.yml | 39 ++++++++++++++++++++++++++------------- .golangci.yml | 2 -- Makefile | 2 +- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6763266..d91776a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ main ] +env: + GO_VERSION: 1.20.x + permissions: contents: read pull-requests: read @@ -21,19 +24,28 @@ jobs: strategy: matrix: - go-version: [1.17] os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v3 + with: + path: src/github.com/containerd/ttrpc + + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VERSION }} + - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.45.0 + version: v1.51.2 args: --timeout=5m skip-cache: true + working-directory: src/github.com/containerd/ttrpc + - name: golangci-lint errors run: golangci-lint run + working-directory: src/github.com/containerd/ttrpc if: ${{ failure() }} # @@ -41,20 +53,20 @@ jobs: # project: name: Project Checks - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 timeout-minutes: 5 steps: - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.17' + go-version: ${{ env.GO_VERSION }} - uses: actions/checkout@v3 with: path: src/github.com/containerd/ttrpc fetch-depth: 25 - - uses: containerd/project-checks@v1 + - uses: containerd/project-checks@v1.1.0 with: working-directory: src/github.com/containerd/ttrpc @@ -66,14 +78,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - name: ${{ matrix.os }} + go: [1.19.x, 1.20.x] + + name: ${{ matrix.os }} / ${{ matrix.go }} runs-on: ${{ matrix.os }} timeout-minutes: 5 steps: - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: '1.17' + go-version: ${{ matrix.go }} - name: Check out code uses: actions/checkout@v3 @@ -101,14 +115,13 @@ jobs: # protobuild: name: Run Protobuild - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 5 steps: - - name: Set up Go 1.17 - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: ${{ env.GO_VERSION }} id: go - name: Setup Go binary path diff --git a/.golangci.yml b/.golangci.yml index c8be498..6462e52 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,5 @@ linters: enable: - - structcheck - - varcheck - staticcheck - unconvert - gofmt diff --git a/Makefile b/Makefile index 4741942..c3a497d 100644 --- a/Makefile +++ b/Makefile @@ -151,7 +151,7 @@ install-protobuild: coverage: ## generate coverprofiles from the unit tests, except tests that require root @echo "$(WHALE) $@" @rm -f coverage.txt - @$(GO) test -i ${TESTFLAGS} ${TESTPACKAGES} 2> /dev/null + @$(GO) test ${TESTFLAGS} ${TESTPACKAGES} 2> /dev/null @( for pkg in ${PACKAGES}; do \ $(GO) test ${TESTFLAGS} \ -cover \