Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
ci: update actions (#201)
Browse files Browse the repository at this point in the history
* ci: update actions

* use golangci-lint-action

* update to 1.56.2

* update actions versions
  • Loading branch information
miparnisari authored Feb 19, 2024
1 parent 7fa88e3 commit d61bf5c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
GOLANGCI_LINT_VERSION: v1.55.2
GOLANGCI_LINT_VERSION: v1.56.2

jobs:
lint:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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"
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches: [ master ]

env:
GOLANGCI_LINT_VERSION: v1.56.2

jobs:
test:
name: test
Expand All @@ -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') }}
Expand All @@ -40,19 +43,25 @@ 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:
runs-on: ubuntu-latest
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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d61bf5c

Please sign in to comment.