PMM-12339 remove go tip (#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 <artem.gavrilov@percona.com>
This commit is contained in:
Alex Tymchuk 2023-07-19 17:33:24 +03:00 committed by GitHub
parent 60937ab304
commit 74815fb098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 11 deletions

View File

@ -13,8 +13,6 @@ jobs:
name: Test
strategy:
matrix:
go-version:
- 1.19
postgresql-image:
- postgres:10
- postgres:11
@ -26,18 +24,20 @@ jobs:
environment:
name: CI
steps:
- name: Set up Go release
uses: percona-platform/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: percona-platform/checkout@v3
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: ${{ github.workspace }}/go.mod
- name: Run checks
run: |
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
go build -modfile=tools/go.mod -o bin/reviewdog github.com/reviewdog/reviewdog/cmd/reviewdog
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
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
- name: Run Tests
run: |
sudo chown 999:999 testdata/ssl/server/*
@ -47,6 +47,7 @@ jobs:
make test
env:
POSTGRESQL_IMAGE: ${{ matrix.postgresql-image }}
- name: Run debug commands on failure
if: ${{ failure() }}
run: |

View File

@ -17,13 +17,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
go-version-file: ${{ github.workspace }}/go.mod
- name: Install snmp_exporter/generator dependencies
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
if: github.repository == 'prometheus/snmp_exporter'
- name: Lint
uses: golangci/golangci-lint-action@v3.6.0
with:

View File

@ -58,6 +58,7 @@ endif
PROMU_VERSION ?= 0.13.0
PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
SKIP_GOLANGCI_LINT ?= $(CI)
GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.45.2
@ -67,7 +68,9 @@ ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
# If we're in CI and there is an Actions file, that means the linter
# is being run in Actions, so we don't need to run it here.
ifeq (,$(CIRCLE_JOB))
ifneq (,$(SKIP_GOLANGCI_LINT))
GOLANGCI_LINT :=
else ifeq (,$(CIRCLE_JOB))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint

View File

@ -1,5 +1,4 @@
---
version: '3'
services:
postgresql:
image: ${POSTGRESQL_IMAGE:-postgres}