From eaf48d4d5be594c80a50f3d7f9187704c0edde3c Mon Sep 17 00:00:00 2001 From: enitrat Date: Thu, 5 Dec 2024 15:19:56 +0800 Subject: [PATCH] install LLVM in action instead of sh script --- .github/actions/setup_native_deps/action.yml | 17 +++++++++++++---- .github/workflows/ci.yml | 2 -- .github/workflows/test.yml | 4 ++++ .github/workflows/trunk-check.yml | 4 ++++ scripts/dependencies.sh | 6 ++---- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup_native_deps/action.yml b/.github/actions/setup_native_deps/action.yml index 01547a8b..a23786d3 100644 --- a/.github/actions/setup_native_deps/action.yml +++ b/.github/actions/setup_native_deps/action.yml @@ -22,9 +22,18 @@ runs: key: ${{ runner.os }}-llvm-19-${{ hashFiles('scripts/dependencies.sh') }} - - name: Install Cairo Native Runtime Dependencies + - name: Add LLVM Debian repository + if: steps.cache-llvm.outputs.cache-hit != 'true' + uses: myci-actions/add-deb-repo@11 + with: + repo: deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main + repo-name: llvm-repo + keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key + - name: Update and upgrade APT + if: steps.cache-llvm.outputs.cache-hit != 'true' + shell: bash + run: sudo apt-get update && sudo apt-get upgrade -y + - name: Install LLVM if: steps.cache-llvm.outputs.cache-hit != 'true' - id: set-runtime-deps shell: bash - run: | - bash ./scripts/dependencies.sh + run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c80fbf6a..d5ba9cf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,6 @@ on: branches: - main -permissions: read-all - jobs: trunk: name: Trunk diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f21aa1e7..fd3f3cab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,10 @@ jobs: test: # trunk-ignore(actionlint/runner-label) runs-on: ubuntu-latest-16-cores + env: + MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ + LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ + TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ timeout-minutes: 45 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/trunk-check.yml b/.github/workflows/trunk-check.yml index 6481f605..fc81c9ca 100644 --- a/.github/workflows/trunk-check.yml +++ b/.github/workflows/trunk-check.yml @@ -11,6 +11,10 @@ jobs: trunk_check: name: Trunk Check Runner runs-on: ubuntu-latest + env: + MLIR_SYS_190_PREFIX: /usr/lib/llvm-19/ + LLVM_SYS_191_PREFIX: /usr/lib/llvm-19/ + TABLEGEN_190_PREFIX: /usr/lib/llvm-19/ # trunk-ignore(checkov/CKV2_GHA_1) permissions: checks: write # For trunk to post annotations diff --git a/scripts/dependencies.sh b/scripts/dependencies.sh index 40be63f7..5dac7648 100644 --- a/scripts/dependencies.sh +++ b/scripts/dependencies.sh @@ -30,11 +30,9 @@ function setup_llvm_deps() { brew install llvm@19 ;; Linux) - $SUDO bash -c 'curl https://apt.llvm.org/llvm.sh -Lo llvm.sh - bash ./llvm.sh 19 all - rm -f ./llvm.sh - apt update && apt install -y \ + $SUDO bash -c 'apt update && apt-get install -y \ libgmp3-dev \ + llvm-19 \ libmlir-19-dev \ libpolly-19-dev \ libzstd-dev \