Skip to content

Commit 0c126c1

Browse files
committed
init commit
Signed-off-by: peefy <[email protected]>
0 parents  commit 0c126c1

File tree

189 files changed

+69459
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+69459
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- "releases/*"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
rust-test:
14+
strategy:
15+
matrix:
16+
os: [macos-latest, ubuntu-latest, windows-latest]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- name: Git checkout
20+
uses: actions/checkout@v2
21+
- name: Install rust nightly toolchain
22+
uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: 1.73
25+
override: true
26+
components: clippy, rustfmt
27+
- name: Rust code test
28+
run: cargo test
29+
30+
go-test:
31+
strategy:
32+
matrix:
33+
os: [macos-latest, ubuntu-latest, windows-latest]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- name: Git checkout
37+
uses: actions/checkout@v2
38+
- name: Set up Go
39+
uses: actions/setup-go@v2
40+
with:
41+
go-version: 1.21
42+
- name: Go code test
43+
run: go test ./...
44+
45+
python-test:
46+
strategy:
47+
matrix:
48+
os: [macos-latest, ubuntu-latest, windows-latest]
49+
runs-on: ${{ matrix.os }}
50+
steps:
51+
- name: Git checkout
52+
uses: actions/checkout@v2
53+
- uses: actions/setup-python@v4
54+
with:
55+
python-version: '3.9'
56+
- name: Install dependencies
57+
working-directory: python
58+
run: |
59+
python3 -m pip install -r ./scripts/requirements.txt
60+
python3 -m pip install pytest
61+
python3 -m pip install setuptools wheel twine
62+
- name: Python code test
63+
working-directory: python
64+
run: python3 -m pytest
65+
66+
java-test:
67+
permissions:
68+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
69+
contents: read # for actions/checkout to fetch code
70+
name: "${{ matrix.root-pom }} on JDK ${{ matrix.java }} for the classifier ${{ matrix.classifier }}"
71+
strategy:
72+
matrix:
73+
include:
74+
- os: ubuntu-latest
75+
classifier: linux-x86_64
76+
java: 8
77+
root-pom: 'pom.xml'
78+
- os: ubuntu-latest
79+
classifier: linux-aarch_64
80+
java: 8
81+
root-pom: 'pom.xml'
82+
- os: windows-latest
83+
classifier: windows-x86_64
84+
java: 8
85+
root-pom: 'pom.xml'
86+
- os: macos-latest
87+
classifier: osx-x86_64
88+
java: 8
89+
root-pom: 'pom.xml'
90+
- os: macos-latest
91+
classifier: osx-aarch_64
92+
java: 8
93+
root-pom: 'pom.xml'
94+
runs-on: ${{ matrix.os }}
95+
env:
96+
ROOT_POM: ${{ matrix.root-pom }}
97+
steps:
98+
- name: 'Check out repository'
99+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
100+
- name: 'Set up JDK ${{ matrix.java }}'
101+
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
102+
with:
103+
java-version: ${{ matrix.java }}
104+
distribution: 'zulu'
105+
cache: 'maven'
106+
server-id: sonatype-nexus-snapshots
107+
server-username: CI_DEPLOY_USERNAME
108+
server-password: CI_DEPLOY_PASSWORD
109+
- uses: actions/setup-python@v5
110+
with:
111+
python-version: '3.10'
112+
- name: Install rust nightly toolchain
113+
uses: actions-rs/toolchain@v1
114+
with:
115+
toolchain: 1.73
116+
override: true
117+
components: clippy, rustfmt
118+
119+
- name: Setup linux-aarch_64 rust target
120+
if: "contains(matrix.classifier, 'linux-aarch_64')"
121+
run: |
122+
sudo apt-get update
123+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
124+
# Setup for cargo
125+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
126+
127+
- name: 'Build and Deploy'
128+
shell: bash
129+
working-directory: java
130+
run: make # && make deploy
131+
env:
132+
CI_DEPLOY_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}
133+
CI_DEPLOY_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}

.github/workflows/cla.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
jobs:
8+
CLAssistant:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: "CLA Assistant"
12+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
13+
uses: contributor-assistant/[email protected]
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
# the below token should have repo scope and must be manually added by you in the repository's secret
17+
PERSONAL_ACCESS_TOKEN : ${{ secrets.DEPLOY_ACCESS_TOKEN }}
18+
with:
19+
path-to-document: 'https://github.com/kcl-lang/.github/blob/main/CLA.md' # e.g. a CLA or a DCO document
20+
21+
# branch should not be protected
22+
lock-pullrequest-aftermerge: True
23+
path-to-signatures: 'signatures/version1/cla.json'
24+
remote-organization-name: kcl-lang
25+
remote-repository-name: cla.db
26+
branch: 'main'
27+
allowlist: bot*
28+
29+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
30+
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
31+
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
32+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
33+
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
34+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
35+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
36+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
37+
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
38+
#use-dco-flag: true - If you are using DCO instead of CLA
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release Python
2+
on:
3+
push:
4+
tags:
5+
- "v*"
6+
permissions:
7+
contents: write
8+
jobs:
9+
python-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Git checkout
13+
uses: actions/checkout@v2
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.9'
17+
- name: Install dependencies
18+
working-directory: python
19+
run: |
20+
python3 -m pip install -r ./scripts/requirements.txt
21+
python3 -m pip install pytest
22+
python3 -m pip install setuptools wheel twine
23+
- name: Python code test
24+
working-directory: python
25+
run: python3 -m pytest
26+
- name: Upload pypi
27+
working-directory: python
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: make dist

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
3+
*.a
4+
*.o
5+
*.so
6+
7+
*.exe
8+
*.lib
9+
*.dll
10+
11+
a.out*
12+
zz_*
13+
/_build*
14+
*.dylib
15+
*.lock
16+
.kclvm
17+
18+
# KCL cache and temp output
19+
.kclvm
20+
.kclvm_cov
21+
*.dylib
22+
*.so
23+
*.dll
24+
*.d
25+
*.lock
26+
*.ll
27+
*.ll.lock
28+
_a.out.*
29+
_a.out_*.*
30+
31+
**/target/
32+
**/.DS_Store
33+
**/.vscode
34+
__pycache__
35+
36+
!lib/**/*.dylib
37+
!lib/**/*.dll
38+
!lib/**/*.lib
39+
!lib/**/*.so
40+
!lib/**/*.exe
41+
!scripts/*.exe

Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "kcl-lang"
3+
version = "0.7.5"
4+
edition = "2021"
5+
readme = "README.md"
6+
documentation = "kcl-lang.io"
7+
description = "KCL Rust SDK"
8+
license = "Apache-2.0"
9+
10+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11+
12+
[dependencies]
13+
prost = "0.11.8"
14+
prost-types = "0.11.8"
15+
serde_json = "1"
16+
anyhow = "1"
17+
serde = { version = "1", features = ["derive"] }
18+
libloading = "0.7.3"
19+
tempfile = "3.5.0"

0 commit comments

Comments
 (0)