Skip to content

Commit

Permalink
Merge pull request #6 from Peefy/chore-semantic-ai
Browse files Browse the repository at this point in the history
Chore semantic ai
  • Loading branch information
Peefy authored Mar 11, 2024
2 parents 232bcc6 + 757d843 commit 6b38328
Show file tree
Hide file tree
Showing 1,701 changed files with 83,479 additions and 26,710 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Backport merged pull request
on:
pull_request_target:
types: [closed]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
jobs:
backport:
name: Backport pull request
runs-on: ubuntu-latest
# Don't run on closed unmerged pull requests
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v3
- name: Create backport pull requests
uses: korthout/backport-action@v1
62 changes: 62 additions & 0 deletions .github/workflows/build-test-linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Test on Linux ARCH64

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test-arm64:
name: Build and Test on Linux ARM64
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21

- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y git wget curl make python3 python3-pip clang-12 lld-12
sudo ln -sf /usr/bin/clang-12 /usr/bin/clang
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.76
override: true
components: clippy, rustfmt

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Pull custom ARM64 Docker image
run: |
docker pull --platform linux/arm64 kcllang/kcl-builder-arm64
- name: Run custom ARM64 Docker image
run: |
docker run --rm --platform linux/arm64 \
-v ${{ github.workspace }}:/workspace -w /workspace \
kcllang/kcl-builder-arm64 \
make && make release
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: kcl-linux-arm64
path: _build/dist/ubuntu/kclvm
46 changes: 46 additions & 0 deletions .github/workflows/build-test-macos-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Test on MacOS ARCH64

on: ["push", "pull_request"]
jobs:
build-and-test:
# Ref: https://github.com/actions/runner-images/tree/main/images/macos
strategy:
matrix:
os: [macos-13-xlarge]
runs-on: ${{ matrix.os }}
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
submodules: "true"

- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.21

- run: clang --version
- run: cargo --version
- run: rustc --print sysroot

- name: Delete rust cargo
run: rm -rf /root/.cargo/bin
shell: bash
- name: Install LLVM 12
run: brew install llvm@12
shell: bash
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.76
override: true
components: clippy, rustfmt
- name: Grammar test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/opt/homebrew/opt/llvm@12/bin/ && make && make test-grammar
shell: bash

- uses: actions/upload-artifact@v3
with:
name: kcl-darwin-arm64
path: _build/dist/Darwin/kclvm
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
PERSONAL_ACCESS_TOKEN : ${{ secrets.KCL_LANG_BOT_TOKEN }}
PERSONAL_ACCESS_TOKEN : ${{ secrets.DEPLOY_ACCESS_TOKEN }}
with:
path-to-document: 'https://github.com/kcl-lang/.github/blob/main/CLA.md' # e.g. a CLA or a DCO document

Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/daily-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Daily Release CI

on:
schedule:
- cron: '0 0 * * *'

permissions:
contents: write

jobs:
macos-release:
name: Build and release on macos
runs-on: macos-11
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
submodules: "true"

- run: clang --version
- run: cargo --version
- run: rustc --print sysroot

- name: Delete rust cargo
run: rm -rf /root/.cargo/bin
shell: bash
- name: Install LLVM 12
run: brew install llvm@12
shell: bash
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.76
override: true
components: clippy, rustfmt

- name: Build KCL
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make build
shell: bash

- uses: actions/upload-artifact@v3
with:
name: kcl-darwin-amd64-nightly
path: _build/dist/Darwin/kclvm

linux-release:
name: Build and release on linux
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"

# Prerequisite

- name: Install LLVM
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y git wget curl make
sudo apt-get install -y clang-12 lld-12
sudo ln -sf /usr/bin/clang-12 /usr/bin/clang
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.76
override: true
components: clippy, rustfmt

- name: Build KCL
run: make build
shell: bash

- uses: actions/upload-artifact@v3
with:
name: kcl-linux-amd64-nightly
path: _build/dist/ubuntu/kclvm

- name: Copy Dockerfile to the current work directory
run: cp scripts/docker/kcl/Dockerfile .
shell: bash
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: kcllang/kclvm
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

windows-release:
name: Build and release on windows
runs-on: windows-latest
env:
LLVM_SYS_120_PREFIX: "C:/LLVM"
KCLVM_CLANG: "C:/LLVM/bin/clang.exe"
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
submodules: "true"

- uses: ilammy/msvc-dev-cmd@v1

- run: clang --version
- run: cargo --version

# Install LLVM-12
- run: Invoke-WebRequest -Uri https://github.com/kcl-lang/llvm-package-windows/releases/download/v12.0.1/LLVM-12.0.1-win64.7z -OutFile C:/LLVM-12.0.1-win64.7z
- run: Get-FileHash -Algorithm MD5 C:/LLVM-12.0.1-win64.7z # md5: 3fcf77f82c6c3ee650711439b20aebe5
- run: 7z x -y C:/LLVM-12.0.1-win64.7z -o"C:/LLVM"
- run: Remove-Item C:/LLVM-12.0.1-win64.7z

- run: echo "C:/LLVM/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- run: .\scripts\build-windows\build.ps1

- run: echo ";$(pwd)\scripts\build-windows\_output\kclvm-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
working-directory: .

- uses: actions/upload-artifact@v3
with:
name: kcl-windows-nightly
path: scripts/build-windows/_output/kclvm-windows
32 changes: 20 additions & 12 deletions .github/workflows/macos_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ jobs:
with:
submodules: "true"

- name: Set up Go 1.18
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.21

- name: Install kpm
run: go install kcl-lang.io/kpm@latest
- name: Install KCL CLI
run: go install kcl-lang.io/cli/cmd/kcl@latest

- run: clang --version
- run: cargo --version
Expand All @@ -34,7 +39,7 @@ jobs:
- name: Install rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.67
toolchain: 1.76
override: true
components: clippy, rustfmt
- name: Code format check
Expand All @@ -43,21 +48,24 @@ jobs:
shell: bash
- name: Grammar test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-grammar
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make && make test-grammar
shell: bash
- name: Runtime test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-runtime
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make && make test-runtime
shell: bash

- name: Unit test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make codecov-lcov
shell: bash
- name: Konfig test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-konfig
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make && make codecov-lcov
shell: bash

- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./kclvm/.kclvm_cov/lcov.info

- uses: actions/upload-artifact@v3
with:
name: kcl-darwin-amd64
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/release.yaml

This file was deleted.

Loading

0 comments on commit 6b38328

Please sign in to comment.