Skip to content

Commit

Permalink
feat: new v0.7.0 kcl cli test scripts and documents.
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Nov 1, 2023
1 parent 451e0af commit 658c60c
Show file tree
Hide file tree
Showing 52 changed files with 756 additions and 309 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2

- run: npm install
- run: npm run build
- name: NPM install
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm install
- name: NPM build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run build
12 changes: 8 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ jobs:
- name: Git checkout
uses: actions/checkout@v2

- run: npm install
# Fix FATAL ERROR - JavaScript heap out of memory
- run: npm install -g increase-memory-limit && increase-memory-limit
- run: npm run build
- name: NPM install
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm install
- name: NPM build
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run build

- name: Deploy kcl-lang/kcl-lang.github.io
uses: peaceiris/actions-gh-pages@v3
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/example-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Install Script
run: static/script/install.sh
- name: Check KCL run
shell: bash -ieo pipefail {0}
run: kcl ./static/stack/main.k

- uses: actions/setup-go@v1
with:
go-version: "1.19"

- name: kpm Installation
run: go install kcl-lang.io/kpm@main
- name: kcl Installation
run: go install kcl-lang.io/cli/cmd/kcl@main

- name: Example tests
shell: bash -ieo pipefail {0}
Expand Down
34 changes: 28 additions & 6 deletions .github/workflows/install-kcl.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: script-kcl
on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -11,12 +14,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Check Install Script
- name: Check Install Script Core
run: static/script/install.sh
- name: Check KCL run
shell: bash -leo pipefail {0}
run: sudo kcl ./static/stack/main.k

- name: Check Install Script CLI
run: static/script/install-cli.sh
- name: Check KCL run
shell: bash -leo pipefail {0}
run: sudo kcl version && sudo kcl run ./static/stack/main.k

- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand All @@ -28,7 +37,7 @@ jobs:
run: python3 -m pip install kclvm --user -U && python3 -m kclvm ./static/stack/main.k

- name: Check Go Installation
run: go install kcl-lang.io/kcl-go/cmds/kcl-go@main && sudo $HOME/go/bin/kcl-go run ./static/stack/main.k
run: go install kcl-lang.io/cli/cmd/kcl@main && sudo $HOME/go/bin/kcl version && sudo $HOME/go/bin/kcl run ./static/stack/main.k

check-linux:
strategy:
Expand All @@ -37,13 +46,21 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Check Install Script
- name: Check Install Script Core
run: static/script/install.sh
- name: Check KCL run
shell: bash -ieo pipefail {0}
run: |
kcl ./static/stack/main.k
- name: Check Install Script CLI
run: static/script/install-cli.sh
- name: Check KCL run
shell: bash -ieo pipefail {0}
run: |
kcl version
kcl run ./static/stack/main.k
- uses: actions/setup-python@v4
with:
python-version: '3.9'
Expand All @@ -55,7 +72,7 @@ jobs:
run: python3 -m pip install kclvm --user -U && python3 -m kclvm ./static/stack/main.k

- name: Check Go Installation
run: go install kcl-lang.io/kcl-go/cmds/kcl-go@main && $HOME/go/bin/kcl-go run ./static/stack/main.k
run: go install kcl-lang.io/cli/cmd/kcl@main && sudo $HOME/go/bin/kcl version && sudo $HOME/go/bin/kcl run ./static/stack/main.k

check-windows:
strategy:
Expand All @@ -65,11 +82,16 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Check Install Script
- name: Check Install Script Core
run: static/script/install.ps1
- name: Check KCL run
run: C:\kclvm\bin\kcl.exe ./static/stack/main.k

- name: Check Install Script CLI
run: static/script/install-cli.ps1
- name: Check KCL run
run: C:\kclvm\bin\kcl.exe run ./static/stack/main.k

- name: Set up Go
uses: actions/setup-go@v2
with:
Expand All @@ -84,7 +106,7 @@ jobs:
run: python3 -m pip install kclvm --user -U && python3 -m kclvm ./static/stack/main.k

- name: Check Go Installation
run: go install kcl-lang.io/kcl-go/cmds/kcl-go@main && C:\Users\runneradmin\go\bin\kcl-go.exe run ./static/stack/main.k
run: go install kcl-lang.io/cli/cmd/kcl@main && C:\Users\runneradmin\go\bin\kcl.exe run ./static/stack/main.k

check-kcl-scoop-install:
runs-on: windows-latest
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# KCL Changelog

+ KCL v0.7.0 - https://github.com/kcl-lang/kcl/releases/tag/v0.7.0-alpha.1
+ KCL v0.6.0 - https://github.com/kcl-lang/kcl/releases/tag/v0.6.0
+ KCL v0.5.6 - https://github.com/kcl-lang/kcl/releases/tag/v0.5.6
+ KCL v0.5.5 - https://github.com/kcl-lang/kcl/releases/tag/v0.5.5
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.7.0
38 changes: 13 additions & 25 deletions docs/user_docs/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ sidebar_position: 2

### From the Binary Releases

Each release of KCL includes various OSes and architectures. These binary versions can be manually downloaded and installed from [Github](https://github.com/kcl-lang/kcl/releases/) or [Gitee](https://gitee.com/kusionstack/kcl/releases) and add `{install-location}/kclvm/bin` to the environment PATH.
Each release of KCL includes various OSes and architectures. These binary versions can be manually downloaded and installed from [Github](https://github.com/kcl-lang/cli/releases/) or [Gitee](https://gitee.com/kusionstack/kcl/releases) and add `{install-location}` to the environment PATH.

> ⚠️ If you cannot successfully access Github, you can also access Gitee to obtain binaries for installation.
#### MacOS & Linux

```bash
export PATH=$PATH:{install-location}/kclvm/bin
export PATH=$PATH:{install-location}
```

#### Windows

```powershell
$env:PATH += ";{install-location}\kclvm\bin;"
$env:PATH += ";{install-location};"
```

### Using script to install the latest release
Expand All @@ -31,31 +31,35 @@ $env:PATH += ";{install-location}\kclvm\bin;"
Install or upgrade the latest darwin KCL to /usr/local/kclvm/bin

```bash
curl -fsSL https://kcl-lang.io/script/install.sh | /bin/bash
curl -fsSL https://kcl-lang.io/script/install-cli.sh | /bin/bash
```

#### Linux

Install or upgrade the latest linux KCL to /usr/local/kclvm/bin

```bash
wget -q https://kcl-lang.io/script/install.sh -O - | /bin/bash
wget -q https://kcl-lang.io/script/install-cli.sh -O - | /bin/bash
```

#### Windows

Install or upgrade the latest windows KCL to $Env:SystemDrive\kclvm\bin and add this directory to User PATH environment variable.

```bash
powershell -Command "iwr -useb https://kcl-lang.io/script/install.ps1 | iex"
powershell -Command "iwr -useb https://kcl-lang.io/script/install-cli.ps1 | iex"
```

### Homebrew (MacOS)

+ Install

```bash
# Install the latest version
brew install kcl-lang/tap/kcl

# Specify a version
brew install [email protected]
```

+ Upgrade
Expand All @@ -81,20 +85,12 @@ scoop install kcl-lang/kcl

### From Go

Install `kcl` through the `Go` command (`Go` requires 1.18+).

```bash
go install kcl-lang.io/kcl-go/cmds/kcl-go@main
```

Add an alias for the kcl command (optional).
Install `kcl` through the `Go` command (`Go` requires 1.19+).

```bash
alias kcl='kcl-go run'
go install kcl-lang.io/cli/cmd/kcl@latest
```

> Note: `kcl-go` does not rely on the installation of `kcl`, but if `kcl` exists in PATH, it will be used by `kcl-go` first.
### From Docker

+ Command
Expand All @@ -114,15 +110,7 @@ docker pull kcllang/kcl
We can execute the following command to ensure that KCL has been installed correctly.

```bash
kcl -V
```

The output may looks like this:

```bash
Version: {kcl version}
Platform: {your platform}
GitCommit: {git commit}
kcl --help
```

For all the above operating systems and installation methods, if you want to use [KCL Python Plugin](/docs/reference/plugin/overview), you need to ensure that Python 3.7+ is installed and add the python3 command to your PATH environment variable.
Expand Down
3 changes: 0 additions & 3 deletions docs/user_docs/guides/package-management/1-overview.md

This file was deleted.

55 changes: 0 additions & 55 deletions docs/user_docs/guides/package-management/2-installation.md

This file was deleted.

Loading

0 comments on commit 658c60c

Please sign in to comment.