From d61bf5cb6ba1919631e4175352a97b38be63ca8e Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Mon, 19 Feb 2024 17:18:55 -0300 Subject: [PATCH] ci: update actions (#201) * ci: update actions * use golangci-lint-action * update to 1.56.2 * update actions versions --- .github/workflows/lint.yaml | 2 +- .github/workflows/master.yaml | 6 +++--- .github/workflows/on-pull-request.yml | 19 ++++++++++++++----- .github/workflows/on-release.yml | 2 +- Makefile | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 40905596..9b007810 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,7 +6,7 @@ on: pull_request: env: - GOLANGCI_LINT_VERSION: v1.55.2 + GOLANGCI_LINT_VERSION: v1.56.2 jobs: lint: diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index 0977635d..34450a84 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version-file: './go.mod' cache-dependency-path: './go.sum' @@ -40,7 +40,7 @@ jobs: comment-on-alert: true - name: Save benchmark JSON to cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 with: path: ./cache/benchmark-data.json # Save with commit hash to avoid "cache already exists" diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index 76da76b0..d89825f7 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -4,6 +4,9 @@ on: pull_request: branches: [ master ] +env: + GOLANGCI_LINT_VERSION: v1.56.2 + jobs: test: name: test @@ -25,12 +28,12 @@ jobs: run: ./contrib/check-version.sh - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Cache deps - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -40,6 +43,12 @@ jobs: - name: Install deps run: go mod download + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: ${{ env.GOLANGCI_LINT_VERSION }} + skip-cache: true + - name: Test run: go test -v -race -p=1 -count=1 go-bench: @@ -47,12 +56,12 @@ jobs: timeout-minutes: 30 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # to be able to retrieve the last commit in master branch - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: './go.mod' cache-dependency-path: './go.sum' @@ -71,7 +80,7 @@ jobs: - name: Get benchmark JSON from Master branch id: cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ./cache/benchmark-data.json key: ${{ steps.get-master-branch-sha.outputs.sha }}-${{ runner.os }}-go-benchmark diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index ff5bd161..c4a19c66 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -33,7 +33,7 @@ jobs: password: ${{ github.token }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: tags: | ghcr.io/mailgun/gubernator:${{ github.event.release.tag_name }} diff --git a/Makefile b/Makefile index 713cd3f0..7c77cca8 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION=$(shell cat version) LDFLAGS="-X main.Version=$(VERSION)" GOLANGCI_LINT = $(GOPATH)/bin/golangci-lint -GOLANGCI_LINT_VERSION = 1.55.2 +GOLANGCI_LINT_VERSION = 1.56.2 $(GOLANGCI_LINT): curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin $(GOLANGCI_LINT_VERSION)