CI: build with/require go 1.20 (#2031)
This commit is contained in:
parent
06ddd01c70
commit
5ff6bfba9c
14 changed files with 35 additions and 34 deletions
4
.github/workflows/bats-hub.yml
vendored
4
.github/workflows/bats-hub.yml
vendored
|
@ -23,10 +23,10 @@ jobs:
|
|||
sudo chmod +w /etc/machine-id
|
||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
|
||||
|
||||
- name: "Set up Go 1.19"
|
||||
- name: "Set up Go 1.20"
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
|
||||
- name: "Clone CrowdSec"
|
||||
|
|
6
.github/workflows/bats-mysql.yml
vendored
6
.github/workflows/bats-mysql.yml
vendored
|
@ -10,9 +10,7 @@ on:
|
|||
env:
|
||||
PREFIX_TEST_NAMES_WITH_FILE: true
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: "Build + tests"
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -32,10 +30,10 @@ jobs:
|
|||
sudo chmod +w /etc/machine-id
|
||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
|
||||
|
||||
- name: "Set up Go 1.19"
|
||||
- name: "Set up Go 1.20"
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
|
||||
- name: "Check out CrowdSec repository"
|
||||
|
|
5
.github/workflows/bats-postgres.yml
vendored
5
.github/workflows/bats-postgres.yml
vendored
|
@ -7,7 +7,6 @@ env:
|
|||
PREFIX_TEST_NAMES_WITH_FILE: true
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: "Build + tests"
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -32,10 +31,10 @@ jobs:
|
|||
sudo chmod +w /etc/machine-id
|
||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
|
||||
|
||||
- name: "Set up Go 1.19"
|
||||
- name: "Set up Go 1.20"
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
|
||||
- name: "Check out CrowdSec repository"
|
||||
|
|
4
.github/workflows/bats-sqlite-coverage.yml
vendored
4
.github/workflows/bats-sqlite-coverage.yml
vendored
|
@ -21,10 +21,10 @@ jobs:
|
|||
sudo chmod +w /etc/machine-id
|
||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
|
||||
|
||||
- name: "Set up Go 1.19"
|
||||
- name: "Set up Go 1.20"
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
|
||||
- name: "Check out CrowdSec repository"
|
||||
|
|
4
.github/workflows/ci-windows-build-msi.yml
vendored
4
.github/workflows/ci-windows-build-msi.yml
vendored
|
@ -25,10 +25,10 @@ jobs:
|
|||
name: Build
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
- name: Set up Go 1.20
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
|
9
.github/workflows/ci_golangci-lint.yml
vendored
9
.github/workflows/ci_golangci-lint.yml
vendored
|
@ -24,18 +24,15 @@ jobs:
|
|||
name: lint
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
- name: Set up Go 1.20
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.50
|
||||
version: v1.51
|
||||
args: --issues-exit-code=1 --timeout 10m
|
||||
only-new-issues: false
|
||||
|
|
4
.github/workflows/go-tests-windows.yml
vendored
4
.github/workflows/go-tests-windows.yml
vendored
|
@ -26,10 +26,10 @@ jobs:
|
|||
|
||||
steps:
|
||||
|
||||
- name: "Set up Go 1.19"
|
||||
- name: "Set up Go 1.20"
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
|
||||
- name: Check out CrowdSec repository
|
||||
|
|
5
.github/workflows/go-tests.yml
vendored
5
.github/workflows/go-tests.yml
vendored
|
@ -33,11 +33,10 @@ env:
|
|||
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ["1.19", "1.20.0-rc.1"]
|
||||
go-version: ["1.20.1"]
|
||||
|
||||
name: "Build + tests"
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -74,7 +73,7 @@ jobs:
|
|||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
|
||||
kafka1:
|
||||
image: crowdsecurity/kafka-ssl
|
||||
ports:
|
||||
|
|
|
@ -11,10 +11,10 @@ jobs:
|
|||
name: Build and upload binary package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
- name: Set up Go 1.20
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
@ -32,10 +32,10 @@ jobs:
|
|||
name: Build and upload binary package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go 1.19
|
||||
- name: Set up Go 1.20
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
go-version: 1.20.1
|
||||
id: go
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
|
|
@ -71,6 +71,7 @@ linters:
|
|||
# - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
|
||||
# - exportloopref # checks for pointers to enclosing loop variables
|
||||
# - funlen # Tool for detection of long functions
|
||||
# - ginkgolinter # enforces standards of using ginkgo and gomega
|
||||
# - gochecknoinits # Checks that no init functions are present in Go code
|
||||
# - gocritic # Provides diagnostics that check for bugs, performance and style issues.
|
||||
# - goheader # Checks is file header matches to pattern
|
||||
|
@ -115,6 +116,7 @@ linters:
|
|||
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt.
|
||||
- gosec # (gas): Inspects source code for security problems
|
||||
- lll # Reports long lines
|
||||
- musttag # enforce field tags in (un)marshaled structs
|
||||
- nakedret # Finds naked returns in functions greater than a specified function length
|
||||
- nonamedreturns # Reports all named returns
|
||||
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
|
||||
|
@ -182,6 +184,9 @@ linters:
|
|||
|
||||
|
||||
issues:
|
||||
# “Look, that’s why there’s rules, understand? So that you think before you
|
||||
# break ‘em.” ― Terry Pratchett
|
||||
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 10
|
||||
exclude-rules:
|
||||
|
@ -220,3 +225,7 @@ issues:
|
|||
- linters:
|
||||
- gocritic
|
||||
text: "commentFormatting: put a space between `//` and comment text"
|
||||
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: "x509.ParseCRL has been deprecated since Go 1.19: Use ParseRevocationList instead"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim: set ft=dockerfile:
|
||||
ARG GOVERSION=1.19
|
||||
ARG GOVERSION=1.20.1
|
||||
|
||||
FROM golang:${GOVERSION}-alpine AS build
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# vim: set ft=dockerfile:
|
||||
ARG GOVERSION=1.19
|
||||
ARG GOVERSION=1.20.1
|
||||
|
||||
FROM golang:${GOVERSION}-bullseye AS build
|
||||
|
||||
|
|
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ CSCLI_BIN = cscli$(EXT)
|
|||
BUILD_CMD = build
|
||||
|
||||
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
||||
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 19
|
||||
MINIMUM_SUPPORTED_GO_MINOR_VERSION = 20
|
||||
|
||||
go_major_minor = $(subst ., ,$(BUILD_GOVERSION))
|
||||
GO_MAJOR_VERSION = $(word 1, $(go_major_minor))
|
||||
|
|
|
@ -25,12 +25,11 @@ stages:
|
|||
custom: 'tool'
|
||||
arguments: 'install --global SignClient --version 1.3.155'
|
||||
- task: GoTool@0
|
||||
displayName: "Install Go 1.19"
|
||||
displayName: "Install Go 1.20"
|
||||
inputs:
|
||||
version: '1.19'
|
||||
version: '1.20.1'
|
||||
|
||||
- pwsh: |
|
||||
choco install -y jq
|
||||
choco install -y make
|
||||
displayName: "Install builds deps"
|
||||
- task: PowerShell@2
|
||||
|
|
Loading…
Reference in a new issue