Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] GitHub Action supports building and testing as KCL on macos-arm64 and Linux arch64 systems. #1015

Closed
2 tasks
Peefy opened this issue Jan 30, 2024 · 8 comments · Fixed by #1025
Closed
2 tasks
Assignees
Labels
ci good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Peefy
Copy link
Contributor

Peefy commented Jan 30, 2024

Enhancement

  • macos arm64 CI using the self-hosted runner
name: Build and Test on macOS ARM64

on: [push, pull_request]

jobs:
  build-and-test:
    runs-on: [self-hosted, macos-arm64] # or macos-12-xlarge
    steps:
    - uses: actions/checkout@v3
    - name: Build and test
      run: |
         ....
  • linux arch64 CI using QEMU with the builder image kcllang/kcl-builder-arm64
name: Build and Test on Linux AARCH64

on: [push, pull_request]

jobs:
  build-and-test:
    runs-on: ubuntu-20.04
    steps:
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
        with:
          platforms: linux/amd64,linux/arm64/v8
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Run custom ARM64 Docker image
        run: |
          docker run --rm --platform linux/arm64/v8 \
            -v ${{ github.workspace }}:/workspace -w /workspace \
            kcllang/kcl-builder-arm64 \
            make
        ..
@Peefy Peefy added good first issue Good for newcomers help wanted Extra attention is needed ci labels Jan 30, 2024
@baoyachi
Copy link

Recommended: https://github.com/cross-rs/cross.

E.g: build-cross

@Peefy
Copy link
Contributor Author

Peefy commented Jan 30, 2024

Recommended: https://github.com/cross-rs/cross.

E.g: build-cross

Thank you! @baoyachi I'll try it. However, I have found that it also relies on QEMU, and I have not found any support for macos arm64 in CI. If you have any other ideas, please feel free to share them.

@UtkarshUmre
Copy link

Hey @Peefy I am new to KCL and learning. I came across this good first issue that I would like to work on. Could you please assign this issue to me and guide me a little bit?

@Peefy
Copy link
Contributor Author

Peefy commented Jan 30, 2024

Hey @Peefy I am new to KCL and learning. I came across this good first issue that I would like to work on. Could you please assign this issue to me and guide me a little bit?

Thank you! @UtkarshUmre The purpose of this issue is to build a CI script for compiling KCL in a Linux arm64 environment using the kclang/kcl-builder-arm64 image.

@UtkarshUmre
Copy link

What I understand is that we need to compile the KCL language code during the continuous integration phase itself in a Linux ARM64 environment, using the kclang/kcl-builder-arm64 image. However, what should be the right approach to do this? It would be really helpful if you could point me to specific resources

@Peefy
Copy link
Contributor Author

Peefy commented Jan 31, 2024

What I understand is that we need to compile the KCL language code during the continuous integration phase itself in a Linux ARM64 environment, using the kclang/kcl-builder-arm64 image. However, what should be the right approach to do this? It would be really helpful if you could point me to specific resources

@UtkarshUmre You can add CI scripts as follows using QEMU and the arm docker image:

  build-and-test-arm64:
    name: Test
    runs-on: ubuntu-latest
    steps:
      # QEMU enables you run arm64 image on x86 machines
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
        with:
          platforms: linux/arm64
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Run custom ARM64 Docker image
        run: |
          docker run --rm \
            -v ${{ github.workspace }}:/workspace -w /workspace \
            kcllang/kcl-builder-arm64 \
            make && make release
      - uses: actions/upload-artifact@v3
        with:
          name: kcl-linux-arm64
          path: _build/dist/ubuntu/kclvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants