Skip to content

Commit 36b3565

Browse files
authored
chore: Update go version to 1.21 (#113)
1 parent 70bd3a6 commit 36b3565

File tree

9 files changed

+91
-41
lines changed

9 files changed

+91
-41
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ updates:
66
interval: "daily"
77
labels:
88
- "dependencies"
9-
- "go"
109
assignees:
1110
- "obalunenko"
1211
reviewers:
@@ -17,6 +16,20 @@ updates:
1716

1817
- package-ecosystem: "github-actions"
1918
directory: "/"
19+
schedule:
20+
interval: "weekly"
21+
labels:
22+
- "dependencies"
23+
assignees:
24+
- "obalunenko"
25+
reviewers:
26+
- "obalunenko"
27+
commit-message:
28+
prefix: "chore"
29+
include: "scope"
30+
31+
- package-ecosystem: "docker"
32+
directory: "/build/docker/go-tools"
2033
schedule:
2134
interval: "daily"
2235
labels:

.github/workflows/codeql-analysis.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,38 @@ on:
1818
# The branches below must be a subset of the branches above
1919
branches: [ master ]
2020
schedule:
21-
- cron: '32 19 * * 6'
21+
- cron: '31 10 * * 0'
2222

2323
jobs:
2424
analyze:
2525
name: Analyze
26-
runs-on: ubuntu-latest
26+
runs-on: ${{ matrix.os }}
2727
permissions:
2828
actions: read
2929
contents: read
3030
security-events: write
3131

3232
strategy:
33-
fail-fast: false
33+
fail-fast: true
3434
matrix:
3535
language: [ 'go' ]
36+
os: [ 'ubuntu-22.04' ]
37+
go: [ '1.21' ]
3638
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3739
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3840

3941
steps:
4042
- name: Checkout repository
4143
uses: actions/checkout@v3
4244

45+
- name: Set up go
46+
uses: actions/setup-go@v4.1.0
47+
with:
48+
go-version: ${{ matrix.go }}
49+
- run: |
50+
go version
51+
shell: bash
52+
4353
# Initializes the CodeQL tools for scanning.
4454
- name: Initialize CodeQL
4555
uses: github/codeql-action/init@v2
@@ -50,21 +60,9 @@ jobs:
5060
# Prefix the list here with "+" to use these queries and those in the config file.
5161
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5262

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v2
57-
58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
60-
61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
64-
65-
#- run: |
66-
# make bootstrap
67-
# make release
63+
- name: Build
64+
run: |
65+
make vet
6866
6967
- name: Perform CodeQL Analysis
7068
uses: github/codeql-action/analyze@v2

.github/workflows/go.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
max-parallel: 3
4242
matrix:
4343
os: [ 'ubuntu-22.04' ]
44-
go: [ '1.20' ]
44+
go: [ '1.21' ]
4545
runs-on: ${{ matrix.os }}
4646
name: Build
4747
steps:
@@ -88,7 +88,7 @@ jobs:
8888
max-parallel: 2
8989
matrix:
9090
os: [ 'ubuntu-22.04' ]
91-
go: [ '1.20' ]
91+
go: [ '1.21' ]
9292
runs-on: ${{ matrix.os }}
9393
name: Run Tests
9494
steps:
@@ -135,7 +135,7 @@ jobs:
135135
max-parallel: 2
136136
matrix:
137137
os: [ 'ubuntu-22.04' ]
138-
go: [ '1.20' ]
138+
go: [ '1.21' ]
139139
runs-on: ${{ matrix.os }}
140140
name: Run linters
141141
steps:
@@ -187,7 +187,7 @@ jobs:
187187
max-parallel: 1
188188
matrix:
189189
os: [ 'ubuntu-22.04' ]
190-
go: [ '1.20' ]
190+
go: [ '1.21' ]
191191
runs-on: ${{ matrix.os }}
192192
name: Quality reports
193193
steps:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
max-parallel: 1
1515
matrix:
1616
os: [ 'ubuntu-22.04' ]
17-
go: [ '1.20' ]
17+
go: [ '1.21' ]
1818
runs-on: ${{ matrix.os }}
1919
name: Release
2020
steps:

build/docker/go-tools/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM ghcr.io/obalunenko/go-tools:v1.0.0 AS builder
2+
3+
CMD ["/bin/sh", "-c", ""]

deployments/docker-compose/go-tools-docker-compose.yml

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,38 @@ version: '3'
22

33
services:
44
tools:
5-
image: ghcr.io/obalunenko/go-tools:${GOTOOLS_IMAGE_TAG:-latest}
5+
build:
6+
context: .
7+
dockerfile: ../../build/docker/go-tools/Dockerfile
68
working_dir: /app/
79
volumes:
810
- ../../:/app/
11+
command: /bin/sh -c ''
12+
13+
vet:
14+
extends:
15+
service: tools
16+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/linting/run-vet.sh'
917

1018
fix-imports:
1119
extends:
1220
service: tools
13-
entrypoint: /bin/sh -c './scripts/style/fix-imports.sh'
21+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/style/fix-imports.sh'
1422

1523
fix-fmt:
1624
extends:
1725
service: tools
18-
entrypoint: /bin/sh -c './scripts/style/fmt.sh'
26+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/style/fmt.sh'
1927

2028
run-tests:
2129
extends:
2230
service: tools
23-
entrypoint: /bin/sh -c './scripts/tests/run.sh'
31+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/tests/run.sh'
2432

2533
run-tests-coverage:
2634
extends:
2735
service: tools
28-
entrypoint: /bin/sh -c './scripts/tests/coverage.sh'
36+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/tests/coverage.sh'
2937

3038
prepare-cover-report:
3139
extends:
@@ -35,17 +43,12 @@ services:
3543
update-readme-coverage:
3644
extends:
3745
service: tools
38-
entrypoint: /bin/sh -c './scripts/update-readme-coverage.sh'
39-
40-
update-readme-doc:
41-
extends:
42-
service: tools
43-
entrypoint: /bin/sh -c './scripts/update-readme-doc.sh'
46+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/update-readme-coverage.sh'
4447

4548
lint-full:
4649
extends:
4750
service: tools
48-
entrypoint: /bin/sh -c './scripts/linting/run-linters.sh'
51+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/linting/run-linters.sh'
4952

5053
lint-pipeline:
5154
extends:
@@ -56,3 +59,34 @@ services:
5659
extends:
5760
service: tools
5861
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/linting/golangci-sonar.sh'
62+
63+
go-generate:
64+
extends:
65+
service: tools
66+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/codegen/go-generate.sh'
67+
68+
release-local-snapshot:
69+
extends:
70+
service: tools
71+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/release/local-snapshot-release.sh'
72+
environment:
73+
APP_NAME: ${APP_NAME}
74+
GOOS: ${GOOS}
75+
GOARCH: ${GOARCH}
76+
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
77+
78+
release-check-config:
79+
extends:
80+
service: tools
81+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/release/check.sh'
82+
environment:
83+
APP_NAME: ${APP_NAME}
84+
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
85+
86+
release:
87+
extends:
88+
service: tools
89+
entrypoint: /bin/sh -c 'git config --global --add safe.directory /app && ./scripts/release/release.sh'
90+
environment:
91+
APP_NAME: ${APP_NAME}
92+
GITHUB_TOKEN: ${GITHUB_TOKEN:-}

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
module github.com/obalunenko/getenv
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.21.0
46

57
require (
68
github.com/stretchr/testify v1.8.4
7-
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090
9+
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
810
)
911

1012
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
44
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
55
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
66
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7-
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090 h1:Di6/M8l0O2lCLc6VVRWhgCiApHV8MnQurBnFSHsQtNY=
8-
golang.org/x/exp v0.0.0-20230725093048-515e97ebf090/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
7+
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
8+
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
99
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1010
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1111
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ github.com/pmezard/go-difflib/difflib
88
## explicit; go 1.20
99
github.com/stretchr/testify/assert
1010
github.com/stretchr/testify/require
11-
# golang.org/x/exp v0.0.0-20230725093048-515e97ebf090
11+
# golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
1212
## explicit; go 1.20
1313
golang.org/x/exp/constraints
1414
# gopkg.in/yaml.v3 v3.0.1

0 commit comments

Comments
 (0)