Skip to content

Commit 9aa161f

Browse files
authored
chore: update CI
* chore: update CI * chore: update CI
1 parent 0a5b16c commit 9aa161f

File tree

7 files changed

+44
-68
lines changed

7 files changed

+44
-68
lines changed

.github/workflows/go-cross.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
go-version: [ '1.21', '1.22' ]
20+
go-version: [ oldstable, stable ]
2121
os: [ubuntu-latest, macos-latest, windows-latest]
2222

2323
include:
@@ -29,36 +29,18 @@ jobs:
2929
go-path-suffix: \go
3030

3131
steps:
32-
# https://github.com/marketplace/actions/setup-go-environment
33-
- name: Set up Go ${{ matrix.go-version }}
34-
uses: actions/setup-go@v2
35-
with:
36-
go-version: ${{ matrix.go-version }}
37-
stable: true
38-
3932
# https://github.com/marketplace/actions/checkout
4033
- name: Checkout code
41-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
4235
with:
4336
path: go/src/github.com/traefik/yaegi
4437

45-
# https://github.com/marketplace/actions/cache
46-
- name: Cache Go modules
47-
uses: actions/cache@v3
38+
# https://github.com/marketplace/actions/setup-go-environment
39+
- name: Set up Go ${{ matrix.go-version }}
40+
uses: actions/setup-go@v5
4841
with:
49-
# In order:
50-
# * Module download cache
51-
# * Build cache (Linux)
52-
# * Build cache (Mac)
53-
# * Build cache (Windows)
54-
path: |
55-
~/go/pkg/mod
56-
~/.cache/go-build
57-
~/Library/Caches/go-build
58-
%LocalAppData%\go-build
59-
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
60-
restore-keys: |
61-
${{ runner.os }}-${{ matrix.go-version }}-go-
42+
go-version: ${{ matrix.go-version }}
43+
stable: true
6244

6345
- name: Setup GOPATH
6446
run: go env -w GOPATH=${{ github.workspace }}${{ matrix.go-path-suffix }}

.github/workflows/main.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: '1.22'
11-
GOLANGCI_LINT_VERSION: v1.55.2
10+
GO_VERSION: stable
11+
GOLANGCI_LINT_VERSION: v1.56.2
1212

1313
jobs:
1414

1515
linting:
1616
name: Linting
1717
runs-on: ubuntu-latest
1818
steps:
19-
- name: Set up Go ${{ env.GO_VERSION }}
20-
uses: actions/setup-go@v2
21-
with:
22-
go-version: ${{ env.GO_VERSION }}
23-
2419
- name: Check out code
25-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
2621
with:
2722
fetch-depth: 0
2823

24+
- name: Set up Go ${{ env.GO_VERSION }}
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
2929
- name: Check and get dependencies
3030
run: |
3131
go mod tidy
@@ -45,19 +45,19 @@ jobs:
4545
needs: linting
4646
strategy:
4747
matrix:
48-
go-version: [ '1.21', '1.22' ]
48+
go-version: [ oldstable, stable ]
4949
steps:
50+
- name: Check out code
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
5055
- name: Set up Go ${{ matrix.go-version }}
51-
uses: actions/setup-go@v2
56+
uses: actions/setup-go@v5
5257
with:
5358
go-version: ${{ matrix.go-version }}
5459
stable: true
5560

56-
- name: Check out code
57-
uses: actions/checkout@v2
58-
with:
59-
fetch-depth: 0
60-
6161
- name: Check generated code
6262
run: |
6363
rm -f interp/op.go
@@ -76,21 +76,21 @@ jobs:
7676
working-directory: ${{ github.workspace }}/go/src/github.com/traefik/yaegi
7777
strategy:
7878
matrix:
79-
go-version: [ '1.21', '1.22' ]
79+
go-version: [ oldstable, stable ]
8080

8181
steps:
82-
- name: Set up Go ${{ matrix.go-version }}
83-
uses: actions/setup-go@v2
84-
with:
85-
go-version: ${{ matrix.go-version }}
86-
stable: true
87-
8882
- name: Check out code
89-
uses: actions/checkout@v2
83+
uses: actions/checkout@v4
9084
with:
9185
path: go/src/github.com/traefik/yaegi
9286
fetch-depth: 0
9387

88+
- name: Set up Go ${{ matrix.go-version }}
89+
uses: actions/setup-go@v5
90+
with:
91+
go-version: ${{ matrix.go-version }}
92+
stable: true
93+
9494
# https://github.com/marketplace/actions/cache
9595
- name: Cache Go modules
9696
uses: actions/cache@v3

.github/workflows/release.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- v[0-9]+.[0-9]+*
77

88
env:
9-
GO_VERSION: '1.21'
9+
GO_VERSION: stable
1010

1111
jobs:
1212

@@ -15,28 +15,20 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- name: Set up Go ${{ env.GO_VERSION }}
19-
uses: actions/setup-go@v2
20-
with:
21-
go-version: ${{ env.GO_VERSION }}
22-
2318
- name: Check out code
24-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2520
with:
2621
fetch-depth: 0
2722

28-
- name: Cache Go modules
29-
uses: actions/cache@v3
23+
- name: Set up Go ${{ env.GO_VERSION }}
24+
uses: actions/setup-go@v5
3025
with:
31-
path: ~/go/pkg/mod
32-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
33-
restore-keys: |
34-
${{ runner.os }}-go-
26+
go-version: ${{ env.GO_VERSION }}
3527

3628
- name: Run GoReleaser
37-
uses: goreleaser/goreleaser-action@v2
29+
uses: goreleaser/goreleaser-action@v5
3830
with:
3931
version: latest
40-
args: release --rm-dist
32+
args: release --clean
4133
env:
4234
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_REPO }}

.golangci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ linters:
142142

143143
issues:
144144
exclude-use-default: false
145-
max-per-linter: 0
145+
max-issues-per-linter: 0
146146
max-same-issues: 0
147-
exclude: []
147+
exclude:
148+
- 'fmt.Sprintf can be replaced with string'
148149
exclude-rules:
149150
- path: .+_test\.go
150151
linters:

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ archives:
4747
- LICENSE
4848

4949
brews:
50-
- tap:
50+
- repository:
5151
owner: traefik
5252
name: homebrew-tap
5353
commit_author:

cmd/yaegi/extract.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bufio"
55
"bytes"
6+
"errors"
67
"flag"
78
"fmt"
89
"io"
@@ -38,7 +39,7 @@ func extractCmd(arg []string) error {
3839

3940
args := eflag.Args()
4041
if len(args) == 0 {
41-
return fmt.Errorf("missing package")
42+
return errors.New("missing package")
4243
}
4344

4445
license, err := genLicense(licensePath)

extract/extract.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ func (e *Extractor) importPath(pkgIdent, importPath string) (string, error) {
387387
return "", err
388388
}
389389
if err != nil {
390-
if len(pkgIdent) > 0 && pkgIdent[0] == '.' {
390+
if pkgIdent != "" && pkgIdent[0] == '.' {
391391
// pkgIdent is definitely a relative path, not a package name, and it does not exist
392392
return "", err
393393
}

0 commit comments

Comments
 (0)