Skip to content

Commit

Permalink
Use Go 1.20; set golangci-lint from GitHub env
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Mar 6, 2023
1 parent a6484b1 commit 4061a69
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ on:
branches:
- main
pull_request:
env:
GOLANGCI_LINT_VERSION: v1.51.2
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
go-version: 1.20.x
- run: go version
- run: diff -u <(echo -n) <(gofmt -d .)
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --verbose
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x, 1.20.x]
go-version: [1.20.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export GOBIN := $(MAKEFILE_PATH)/bin

PATH := $(GOBIN):$(PATH)

GOLANGCI_LINT_VERSION=$(shell awk '/GOLANGCI_LINT_VERSION:/ { print $$2 }' .github/workflows/lint.yml)

.PHONY: all
all: clean format build lint test

Expand All @@ -26,7 +28,7 @@ test:
.PHONY: lint
lint:
@echo lint
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
@$(GOBIN)/golangci-lint run

.PHONY: format
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The tool to import commits from private GitLab to separate repo. Can be used to

# Getting Started

1. Download and install [Go 1.19](https://go.dev/dl/).
1. Download and install [Go 1.20](https://go.dev/dl/).
2. Install the program by running the command in a shell:
```shell
go install github.com/alexandear/import-gitlab-commits@latest
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/alexandear/import-gitlab-commits

go 1.19
go 1.20

require (
github.com/go-git/go-git/v5 v5.2.0
Expand Down

0 comments on commit 4061a69

Please sign in to comment.