Skip to content

Commit 74815fb

Browse files
Alex Tymchukartemgavrilov
Alex Tymchuk
andauthored
PMM-12339 remove go tip (percona#142)
* PMM-12339 remove go tip * PMM-12339 use Go version from go.mod * PMM-12339 Hix CI * PMM-12339 remove a redundant linter run (file missing) * PMM-12339 avoid linting when running tests * PMM-12339 final cleanup --------- Co-authored-by: Artem Gavrilov <[email protected]>
1 parent 60937ab commit 74815fb

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/go.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313
name: Test
1414
strategy:
1515
matrix:
16-
go-version:
17-
- 1.19
1816
postgresql-image:
1917
- postgres:10
2018
- postgres:11
@@ -26,18 +24,20 @@ jobs:
2624
environment:
2725
name: CI
2826
steps:
29-
- name: Set up Go release
30-
uses: percona-platform/setup-go@v2
31-
with:
32-
go-version: ${{ matrix.go-version }}
3327
- name: Checkout code
34-
uses: percona-platform/checkout@v3
28+
uses: actions/checkout@v3
29+
30+
- name: Set up Go
31+
uses: actions/setup-go@v4
32+
with:
33+
go-version-file: ${{ github.workspace }}/go.mod
34+
3535
- name: Run checks
3636
run: |
3737
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
3838
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
39-
bin/golangci-lint run -c=.golangci-required.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-check
4039
bin/golangci-lint run -c=.golangci.yml --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -level=error -reporter=github-pr-review
40+
4141
- name: Run Tests
4242
run: |
4343
sudo chown 999:999 testdata/ssl/server/*
@@ -47,6 +47,7 @@ jobs:
4747
make test
4848
env:
4949
POSTGRESQL_IMAGE: ${{ matrix.postgresql-image }}
50+
5051
- name: Run debug commands on failure
5152
if: ${{ failure() }}
5253
run: |

.github/workflows/golangci-lint.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3
20+
2021
- name: install Go
2122
uses: actions/setup-go@v4
2223
with:
23-
go-version: 1.19.x
24+
go-version-file: ${{ github.workspace }}/go.mod
25+
2426
- name: Install snmp_exporter/generator dependencies
2527
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
2628
if: github.repository == 'prometheus/snmp_exporter'
29+
2730
- name: Lint
2831
uses: golangci/[email protected]
2932
with:

Makefile.common

+4-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ endif
5858
PROMU_VERSION ?= 0.13.0
5959
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
6060

61+
SKIP_GOLANGCI_LINT ?= $(CI)
6162
GOLANGCI_LINT :=
6263
GOLANGCI_LINT_OPTS ?=
6364
GOLANGCI_LINT_VERSION ?= v1.45.2
@@ -67,7 +68,9 @@ ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
6768
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
6869
# If we're in CI and there is an Actions file, that means the linter
6970
# is being run in Actions, so we don't need to run it here.
70-
ifeq (,$(CIRCLE_JOB))
71+
ifneq (,$(SKIP_GOLANGCI_LINT))
72+
GOLANGCI_LINT :=
73+
else ifeq (,$(CIRCLE_JOB))
7174
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
7275
else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
7376
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
version: '3'
32
services:
43
postgresql:
54
image: ${POSTGRESQL_IMAGE:-postgres}

0 commit comments

Comments
 (0)