Skip to content

Commit 005d370

Browse files
authored
Merge pull request #27 from dmcgowan/update-github-actions
Update GitHub actions
2 parents 2e51fd9 + 7c872f6 commit 005d370

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
# Go version we currently use to build containerd across all CI.
1111
# Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions.
12-
GO_VERSION: "1.23.9"
12+
GO_VERSION: "1.25"
1313

1414
permissions: # added using https://github.com/step-security/secure-workflows
1515
contents: read
@@ -29,7 +29,7 @@ jobs:
2929

3030
strategy:
3131
matrix:
32-
os: [ubuntu-22.04, macos-13, windows-2022]
32+
os: [ubuntu-latest, macos-latest, windows-latest]
3333

3434
steps:
3535
- uses: actions/setup-go@v5
@@ -38,19 +38,17 @@ jobs:
3838
cache: false # see actions/setup-go#368
3939

4040
- uses: actions/checkout@v4
41-
- uses: golangci/golangci-lint-action@v6
41+
- uses: golangci/golangci-lint-action@v7
4242
with:
43-
version: v1.61.0
44-
skip-cache: true
45-
args: --timeout=5m
43+
version: v2.1.5
4644

4745
#
4846
# Project checks
4947
#
5048
project:
5149
name: Project Checks
5250
if: github.repository == 'containerd/platforms'
53-
runs-on: ubuntu-22.04
51+
runs-on: ubuntu-latest
5452
timeout-minutes: 5
5553

5654
steps:
@@ -76,7 +74,7 @@ jobs:
7674

7775
strategy:
7876
matrix:
79-
os: [ubuntu-22.04, macos-13, windows-2022]
77+
os: [ubuntu-latest, macos-latest, windows-latest]
8078

8179
steps:
8280
- uses: actions/checkout@v4

.golangci.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
1+
version: "2"
12
linters:
23
enable:
34
- copyloopvar
4-
- gofmt
5-
- goimports
5+
- dupword
66
- gosec
7-
- ineffassign
87
- misspell
98
- nolintlint
109
- revive
11-
- staticcheck
12-
- tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17
1310
- unconvert
14-
- unused
15-
- govet
16-
- dupword # Checks for duplicate words in the source code
1711
disable:
1812
- errcheck
19-
20-
run:
21-
timeout: 5m
22-
23-
issues:
24-
exclude-dirs:
25-
- api
26-
- cluster
27-
- design
28-
- docs
29-
- docs/man
30-
- releases
31-
- reports
32-
- test # e2e scripts
13+
exclusions:
14+
generated: lax
15+
presets:
16+
- comments
17+
- common-false-positives
18+
- legacy
19+
- std-error-handling
20+
formatters:
21+
enable:
22+
- gofmt
23+
- goimports
24+
exclusions:
25+
generated: lax

cpuinfo_other.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func getCPUVariant() (string, error) {
2727

2828
var variant string
2929

30-
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
30+
switch runtime.GOOS {
31+
case "windows", "darwin":
3132
// Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use
3233
// runtime.GOARCH to determine the variants
3334
switch runtime.GOARCH {
@@ -38,7 +39,7 @@ func getCPUVariant() (string, error) {
3839
default:
3940
variant = "unknown"
4041
}
41-
} else if runtime.GOOS == "freebsd" {
42+
case "freebsd":
4243
// FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated)
4344
// detecting those variants is currently unimplemented
4445
switch runtime.GOARCH {
@@ -47,7 +48,7 @@ func getCPUVariant() (string, error) {
4748
default:
4849
variant = "unknown"
4950
}
50-
} else {
51+
default:
5152
return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented)
5253
}
5354

0 commit comments

Comments
 (0)