diff --git a/.github/workflows/build-test-linux-arm64.yml b/.github/workflows/build-test-linux-arm64.yml new file mode 100644 index 000000000..8fbeb9e09 --- /dev/null +++ b/.github/workflows/build-test-linux-arm64.yml @@ -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 1.19 + uses: actions/setup-go@v2 + with: + go-version: 1.19 + + - 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.73 + 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 diff --git a/kclvm/Cargo.lock b/kclvm/Cargo.lock index 3350ec3a7..b603c42c9 100644 --- a/kclvm/Cargo.lock +++ b/kclvm/Cargo.lock @@ -3992,9 +3992,9 @@ checksum = "87d6678d7916394abad0d4b19df4d3802e1fd84abd7d701f39b75ee71b9e8cf1" [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "url" diff --git a/scripts/build.sh b/scripts/build.sh index b592bf779..7581044b7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -23,6 +23,7 @@ prepare_dirs # 1. Build kcl native library cd $topdir/kclvm +export PATH=$PATH:/root/.cargo/bin/ cargo build --release ## Switch dll file extension according to os.