Skip to content

Commit f5c7dec

Browse files
authored
Merge pull request #630 from liangyuanpeng/update_ghaction
chore: update github workflows
2 parents a8c88ed + fb83fc5 commit f5c7dec

File tree

8 files changed

+31
-9
lines changed

8 files changed

+31
-9
lines changed

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
e2e:
1212
name: e2e test
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- name: checkout code
1616
uses: actions/checkout@v4
@@ -19,7 +19,7 @@ jobs:
1919
- name: install Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.23
22+
go-version-file: go.mod
2323

2424
- name: Prepare the test oci registry
2525
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: 1.23
21+
go-version-file: go.mod
2222
- name: Run GoReleaser
2323
uses: goreleaser/goreleaser-action@v6
2424
with:

.github/workflows/test-win.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: 1.23
23+
go-version-file: go.mod
2424

2525
- name: Install Chocolatey and make
2626
run: |

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.23
24+
go-version-file: go.mod
2525

2626
- run: go build ./...
2727
- run: go vet ./...

pkg/client/test_data/issues/github.com/kcl-lang/kcl/issues/1760/a/kcl.mod.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@
1919
reg = "ghcr.io"
2020
repo = "kcl-lang/fluxcd-source-controller"
2121
oci_tag = "v1.3.2"
22+
[dependencies.k8s]
23+
name = "k8s"
24+
full_name = "k8s_1.31.2"
25+
version = "1.31.2"
26+
sum = "xBZgPsnpVVyWBpahuPQHReeRx28eUHGFoaPeqbct+vs="
27+
reg = "ghcr.io"
28+
repo = "kcl-lang/k8s"
29+
oci_tag = "1.31.2"

pkg/client/test_data/resolve_metadata/with_package/kcl.mod.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[dependencies]
22
[dependencies.cc]
33
name = "cc"
4-
full_name = "flask-demo-kcl-manifests_8308200"
4+
full_name = "cc_0.0.1"
55
version = "0.0.1"
66
url = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git"
77
commit = "8308200"

pkg/client/test_data/test_dep_order/kcl.mod.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
name = "helloworld"
44
full_name = "helloworld_0.1.2"
55
version = "0.1.2"
6+
sum = "PN0OMEV9M8VGFn1CtA/T3bcgZmMJmOo+RkBrLKIWYeQ="
67
reg = "ghcr.io"
78
repo = "kcl-lang/helloworld"
89
oci_tag = "0.1.2"
910
[dependencies.jsonpatch]
1011
name = "jsonpatch"
1112
full_name = "jsonpatch_0.0.5"
1213
version = "0.0.5"
14+
sum = "HFrflv3tfgcx+CkCj4Pl7EIXjr+SKH8c+hRI4/A3ThA="
1315
reg = "ghcr.io"
1416
repo = "kcl-lang/jsonpatch"
1517
oci_tag = "0.0.5"

pkg/mvs/mvs_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
"golang.org/x/mod/module"
1111
"kcl-lang.io/kpm/pkg/3rdparty/mvs"
1212
"kcl-lang.io/kpm/pkg/client"
13+
"kcl-lang.io/kpm/pkg/oci"
14+
"kcl-lang.io/kpm/pkg/settings"
1315
"kcl-lang.io/kpm/pkg/test"
1416
"kcl-lang.io/kpm/pkg/utils"
1517
)
@@ -118,7 +120,12 @@ func testUpgradeToLatest(t *testing.T) {
118120

119121
upgrade, err := reqs.Upgrade(module.Version{Path: "k8s", Version: "1.27"})
120122
assert.Equal(t, err, nil)
121-
assert.Equal(t, upgrade, module.Version{Path: "k8s", Version: "1.31.2"})
123+
124+
ociClient, err := oci.NewOciClient("ghcr.io", "kcl-lang/k8s", settings.GetSettings())
125+
assert.Equal(t, err, nil)
126+
tagSelected, err := ociClient.TheLatestTag()
127+
assert.Equal(t, err, nil)
128+
assert.Equal(t, upgrade, module.Version{Path: "k8s", Version: tagSelected})
122129
}
123130

124131
func testUpgradeAllToLatest(t *testing.T) {
@@ -143,15 +150,20 @@ func testUpgradeAllToLatest(t *testing.T) {
143150
upgrade, err := mvs.UpgradeAll(target, reqs)
144151
assert.Equal(t, err, nil)
145152

153+
ociClient, err := oci.NewOciClient("ghcr.io", "kcl-lang/k8s", settings.GetSettings())
154+
assert.Equal(t, err, nil)
155+
tagSelected, err := ociClient.TheLatestTag()
156+
assert.Equal(t, err, nil)
157+
146158
expectedReqs := []module.Version{
147159
{Path: "test_with_external_deps", Version: "0.0.1"},
148160
{Path: "argo-cd-order", Version: "0.2.0"},
149161
{Path: "helloworld", Version: "0.1.4"},
150162
{Path: "json_merge_patch", Version: "0.1.1"},
151-
{Path: "k8s", Version: "1.31.2"},
163+
{Path: "k8s", Version: tagSelected},
152164
{Path: "podinfo", Version: "0.2.1"},
153165
}
154-
assert.Equal(t, upgrade, expectedReqs)
166+
assert.Equal(t, expectedReqs, upgrade)
155167
}
156168

157169
func testPrevious(t *testing.T) {

0 commit comments

Comments
 (0)