1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

chore(deps): update golang version to 1.19 (#4533)

Co-authored-by: I557621 <jordi.van.liempt@sap.com>
This commit is contained in:
Jk1484
2023-08-23 19:29:02 +05:00
committed by GitHub
parent 73de970d81
commit e54d603898
10 changed files with 15 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Install Groovy - name: Install Groovy
run: sudo apt-get update && sudo apt-get install groovy -y run: sudo apt-get update && sudo apt-get install groovy -y

View File

@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Perform update - name: Perform update
run: | run: |
git checkout -B gh-action-update-golang-dependencies git checkout -B gh-action-update-golang-dependencies

View File

@@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- env: - env:
CGO_ENABLED: 0 CGO_ENABLED: 0
run: | run: |

View File

@@ -15,7 +15,7 @@ jobs:
- uses: styfle/cancel-workflow-action@0.10.0 - uses: styfle/cancel-workflow-action@0.10.0
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Cache Golang Packages - name: Cache Golang Packages
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@@ -43,7 +43,7 @@ jobs:
steps: steps:
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Cache Golang Packages - name: Cache Golang Packages
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@@ -79,7 +79,7 @@ jobs:
steps: steps:
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Cache Golang Packages - name: Cache Golang Packages
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
@@ -99,7 +99,7 @@ jobs:
steps: steps:
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '1.18.x' go-version: '1.19.x'
- name: Cache Golang Packages - name: Cache Golang Packages
uses: actions/cache@v3 uses: actions/cache@v3
with: with:

View File

@@ -1,4 +1,4 @@
FROM golang:1.18 AS build-env FROM golang:1.19 AS build-env
COPY . /build COPY . /build
WORKDIR /build WORKDIR /build

View File

@@ -4,13 +4,13 @@
package cmd package cmd
import ( import (
"github.com/google/uuid"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"testing" "testing"
sliceUtils "github.com/SAP/jenkins-library/pkg/piperutils" sliceUtils "github.com/SAP/jenkins-library/pkg/piperutils"
"github.com/google/uuid"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
@@ -143,7 +143,7 @@ func TestRunNewmanExecute(t *testing.T) {
err := runNewmanExecute(&config, &utils) err := runNewmanExecute(&config, &utils)
// assert // assert
assert.EqualError(t, err, "could not parse newman command template: template: template:1: unexpected \"}\" in operand") assert.EqualError(t, err, "could not parse newman command template: template: template:1: bad character U+007D '}'")
}) })
t.Run("error on file search", func(t *testing.T) { t.Run("error on file search", func(t *testing.T) {
@@ -263,7 +263,7 @@ func TestResolveTemplate(t *testing.T) {
config := newmanExecuteOptions{RunOptions: []string{"this", "is", "my", "fancy", "command", "{{.collectionDisplayName}"}} config := newmanExecuteOptions{RunOptions: []string{"this", "is", "my", "fancy", "command", "{{.collectionDisplayName}"}}
_, err := resolveTemplate(&config, "theDisplayName") _, err := resolveTemplate(&config, "theDisplayName")
assert.EqualError(t, err, "could not parse newman command template: template: template:1: unexpected \"}\" in operand") assert.EqualError(t, err, "could not parse newman command template: template: template:1: bad character U+007D '}'")
}) })
} }

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/SAP/jenkins-library module github.com/SAP/jenkins-library
go 1.18 go 1.19
//downgraded for :https://cs.opensource.google/go/x/crypto/+/5d542ad81a58c89581d596f49d0ba5d435481bcf : or else will break for some github instances //downgraded for :https://cs.opensource.google/go/x/crypto/+/5d542ad81a58c89581d596f49d0ba5d435481bcf : or else will break for some github instances
// not downgraded using go get since it breaks other dependencies. // not downgraded using go get since it breaks other dependencies.

View File

@@ -1,5 +1,5 @@
module github.com/example/golang-app module github.com/example/golang-app
go 1.18 go 1.19
require github.com/gorilla/mux v1.8.0 require github.com/gorilla/mux v1.8.0

View File

@@ -1,3 +1,3 @@
module github.com/example/golang-app module github.com/example/golang-app
go 1.18 go 1.19

View File

@@ -30,7 +30,7 @@ class PiperGoUtils implements Serializable {
if (steps.env.REPOSITORY_UNDER_TEST && steps.env.LIBRARY_VERSION_UNDER_TEST) { if (steps.env.REPOSITORY_UNDER_TEST && steps.env.LIBRARY_VERSION_UNDER_TEST) {
steps.echo("Running in a consumer test, building unit-under-test binary for verification.") steps.echo("Running in a consumer test, building unit-under-test binary for verification.")
steps.dockerExecute(script: steps, dockerImage: 'golang:1.18', dockerOptions: '-u 0', dockerEnvVars: [ steps.dockerExecute(script: steps, dockerImage: 'golang:1.19', dockerOptions: '-u 0', dockerEnvVars: [
REPOSITORY_UNDER_TEST: steps.env.REPOSITORY_UNDER_TEST, REPOSITORY_UNDER_TEST: steps.env.REPOSITORY_UNDER_TEST,
LIBRARY_VERSION_UNDER_TEST: steps.env.LIBRARY_VERSION_UNDER_TEST LIBRARY_VERSION_UNDER_TEST: steps.env.LIBRARY_VERSION_UNDER_TEST
]) { ]) {