Skip to content

Commit

Permalink
Merge pull request #15 from kcl-lang/update-go-deps
Browse files Browse the repository at this point in the history
 chore: update kcl go deps and CI tests
  • Loading branch information
Peefy authored Aug 23, 2024
2 parents c2daad6 + ce66f15 commit d2cae9a
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 222 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: build-and-test-linux
on:
pull_request:
push:
branches:
- main
- "releases/*"
jobs:
build-and-test:
# Ref: https://github.com/actions/runner-images/tree/main/images/macos
strategy:
matrix:
os: [ macos-12, macos-14, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: go test
run: go test ./...
38 changes: 0 additions & 38 deletions .github/workflows/cla.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ __pycache__
__kclcache__/
build-result/
dist/
kclvm.egg-info/
.eggs/

# Mac OS X files
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0
0.9.0
5 changes: 2 additions & 3 deletions a_embed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021 The KCL Authors. All rights reserved.
// Copyright The KCL Authors. All rights reserved.

// kclvm plugins.
// kcl plugins.
package kcl_plugin

import (
Expand All @@ -13,7 +13,6 @@ import (

//go:embed README.md
//go:embed hello
//go:embed project_context
//go:embed http
var PluginFS embed.FS

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go 1.22

require (
github.com/valyala/fasthttp v1.55.0
kcl-lang.io/kcl-go v0.9.3
kcl-lang.io/kcl-go v0.10.0-beta.2
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.55.0 h1:Zkefzgt6a7+bVKHnu/YaYSOPfNYNisSVBo/unVCf8k8=
github.com/valyala/fasthttp v1.55.0/go.mod h1:NkY9JtkrpPKmgwV3HTaS2HWaJss9RSIsRVfcxxoHiOM=
kcl-lang.io/kcl-go v0.9.3 h1:zqWgE6SSdoD7VHhapOAmmDCrtqyeBvdOcCeqUfT6eu8=
kcl-lang.io/kcl-go v0.9.3/go.mod h1:X30Qh5/jryvnGanaXGRjsuy/dnj211vPHXpfy7AEspw=
kcl-lang.io/kcl-go v0.10.0-beta.2 h1:MFARFYmDwjMhx1MZtJffMHrgPvHpEvyZivCPd6RrfFI=
kcl-lang.io/kcl-go v0.10.0-beta.2/go.mod h1:I8UMn+qt/yTxwzvz85ku9mil7xwHoOjTpMYgK+9IcAg=
2 changes: 1 addition & 1 deletion hello/plugin_test.py → hello/hello.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The KCL Authors. All rights reserved.
# Copyright The KCL Authors. All rights reserved.

# python3 -m pytest

Expand Down
2 changes: 1 addition & 1 deletion hello/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The KCL Authors. All rights reserved.
# Copyright The KCL Authors. All rights reserved.

INFO = {
'name': 'hello',
Expand Down
2 changes: 1 addition & 1 deletion http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
return nil, err
}
return &plugin.MethodResult{V: map[string]any{
"status": status,
"status": int(status),
"body": string(body),
}}, nil
},
Expand Down
4 changes: 2 additions & 2 deletions http/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestHttpGet(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if data["status"] == 200 {
t.Fatal(resultJson)
if int(data["status"].(float64)) != 200 {
t.Fatal(data["status"])
}
}
8 changes: 8 additions & 0 deletions http/http_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright The KCL Authors. All rights reserved.

# python3 -m pytest

import plugin

def test_http_get():
assert plugin.get("https://www.kcl-lang.io/")["status"] == 200
9 changes: 9 additions & 0 deletions http/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import requests


def get(url: str):
resp = requests.get(url)
return {
"status": resp.status_code,
"body": str(resp.content),
}
59 changes: 0 additions & 59 deletions project_context/api.md

This file was deleted.

94 changes: 0 additions & 94 deletions project_context/plugin.py

This file was deleted.

18 changes: 0 additions & 18 deletions project_context/plugin_test.py

This file was deleted.

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruamel.yaml
requests

0 comments on commit d2cae9a

Please sign in to comment.