CI: build with/require go 1.20 (#2031)
This commit is contained in:
parent
06ddd01c70
commit
5ff6bfba9c
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
|
sudo chmod +w /etc/machine-id
|
||||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /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
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: "Clone CrowdSec"
|
- name: "Clone CrowdSec"
|
||||||
|
|
6
.github/workflows/bats-mysql.yml
vendored
6
.github/workflows/bats-mysql.yml
vendored
|
@ -10,9 +10,7 @@ on:
|
||||||
env:
|
env:
|
||||||
PREFIX_TEST_NAMES_WITH_FILE: true
|
PREFIX_TEST_NAMES_WITH_FILE: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: "Build + tests"
|
name: "Build + tests"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -32,10 +30,10 @@ jobs:
|
||||||
sudo chmod +w /etc/machine-id
|
sudo chmod +w /etc/machine-id
|
||||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /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
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: "Check out CrowdSec repository"
|
- 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
|
PREFIX_TEST_NAMES_WITH_FILE: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: "Build + tests"
|
name: "Build + tests"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -32,10 +31,10 @@ jobs:
|
||||||
sudo chmod +w /etc/machine-id
|
sudo chmod +w /etc/machine-id
|
||||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /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
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: "Check out CrowdSec repository"
|
- 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
|
sudo chmod +w /etc/machine-id
|
||||||
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /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
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: "Check out CrowdSec repository"
|
- 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
|
name: Build
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.20
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
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
|
name: lint
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.20
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
|
||||||
with:
|
|
||||||
go-version: 1.19
|
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
with:
|
||||||
version: v1.50
|
version: v1.51
|
||||||
args: --issues-exit-code=1 --timeout 10m
|
args: --issues-exit-code=1 --timeout 10m
|
||||||
only-new-issues: false
|
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:
|
steps:
|
||||||
|
|
||||||
- name: "Set up Go 1.19"
|
- name: "Set up Go 1.20"
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out CrowdSec repository
|
- name: Check out CrowdSec repository
|
||||||
|
|
3
.github/workflows/go-tests.yml
vendored
3
.github/workflows/go-tests.yml
vendored
|
@ -33,11 +33,10 @@ env:
|
||||||
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
|
CROWDSEC_FEATURE_DISABLE_HTTP_RETRY_BACKOFF: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: ["1.19", "1.20.0-rc.1"]
|
go-version: ["1.20.1"]
|
||||||
|
|
||||||
name: "Build + tests"
|
name: "Build + tests"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -11,10 +11,10 @@ jobs:
|
||||||
name: Build and upload binary package
|
name: Build and upload binary package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.20
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -32,10 +32,10 @@ jobs:
|
||||||
name: Build and upload binary package
|
name: Build and upload binary package
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go 1.19
|
- name: Set up Go 1.20
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.20.1
|
||||||
id: go
|
id: go
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v3
|
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
|
# - 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
|
# - exportloopref # checks for pointers to enclosing loop variables
|
||||||
# - funlen # Tool for detection of long functions
|
# - 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
|
# - gochecknoinits # Checks that no init functions are present in Go code
|
||||||
# - gocritic # Provides diagnostics that check for bugs, performance and style issues.
|
# - gocritic # Provides diagnostics that check for bugs, performance and style issues.
|
||||||
# - goheader # Checks is file header matches to pattern
|
# - 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.
|
- 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
|
- gosec # (gas): Inspects source code for security problems
|
||||||
- lll # Reports long lines
|
- lll # Reports long lines
|
||||||
|
- musttag # enforce field tags in (un)marshaled structs
|
||||||
- nakedret # Finds naked returns in functions greater than a specified function length
|
- nakedret # Finds naked returns in functions greater than a specified function length
|
||||||
- nonamedreturns # Reports all named returns
|
- nonamedreturns # Reports all named returns
|
||||||
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
|
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL.
|
||||||
|
@ -182,6 +184,9 @@ linters:
|
||||||
|
|
||||||
|
|
||||||
issues:
|
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-issues-per-linter: 0
|
||||||
max-same-issues: 10
|
max-same-issues: 10
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
|
@ -220,3 +225,7 @@ issues:
|
||||||
- linters:
|
- linters:
|
||||||
- gocritic
|
- gocritic
|
||||||
text: "commentFormatting: put a space between `//` and comment text"
|
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:
|
# vim: set ft=dockerfile:
|
||||||
ARG GOVERSION=1.19
|
ARG GOVERSION=1.20.1
|
||||||
|
|
||||||
FROM golang:${GOVERSION}-alpine AS build
|
FROM golang:${GOVERSION}-alpine AS build
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# vim: set ft=dockerfile:
|
# vim: set ft=dockerfile:
|
||||||
ARG GOVERSION=1.19
|
ARG GOVERSION=1.20.1
|
||||||
|
|
||||||
FROM golang:${GOVERSION}-bullseye AS build
|
FROM golang:${GOVERSION}-bullseye AS build
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ CSCLI_BIN = cscli$(EXT)
|
||||||
BUILD_CMD = build
|
BUILD_CMD = build
|
||||||
|
|
||||||
MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
|
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_minor = $(subst ., ,$(BUILD_GOVERSION))
|
||||||
GO_MAJOR_VERSION = $(word 1, $(go_major_minor))
|
GO_MAJOR_VERSION = $(word 1, $(go_major_minor))
|
||||||
|
|
|
@ -25,12 +25,11 @@ stages:
|
||||||
custom: 'tool'
|
custom: 'tool'
|
||||||
arguments: 'install --global SignClient --version 1.3.155'
|
arguments: 'install --global SignClient --version 1.3.155'
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.19"
|
displayName: "Install Go 1.20"
|
||||||
inputs:
|
inputs:
|
||||||
version: '1.19'
|
version: '1.20.1'
|
||||||
|
|
||||||
- pwsh: |
|
- pwsh: |
|
||||||
choco install -y jq
|
|
||||||
choco install -y make
|
choco install -y make
|
||||||
displayName: "Install builds deps"
|
displayName: "Install builds deps"
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
|
|
Loading…
Reference in a new issue