diff --git a/.github/cross.toml b/.github/cross.toml new file mode 100644 index 0000000..fe14528 --- /dev/null +++ b/.github/cross.toml @@ -0,0 +1,7 @@ +[target.armv7-unknown-linux-gnueabihf] +# Ubuntu 24.04 toolchain supports LightGBM current C++ and CMake requirements. +# Pinned official cross-rs main image for reproducible CI builds. +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:7c3c5764f6daad4871955a5cfda700a9371b90aac02dd9a6f39a6d12c5576c21" + +# Verify and install the CMake version required by LightGBM. +pre-build = ["apt-get update && apt-get install --assume-yes --no-install-recommends ca-certificates curl && curl --fail --location --retry 3 https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.tar.gz --output /tmp/cmake.tar.gz && echo 5a1133ff103c71eb5120e2cc3de922733e7d8a26a98ae716397e8676adb367bf /tmp/cmake.tar.gz | sha256sum --check - && tar -xzf /tmp/cmake.tar.gz --strip-components=1 -C /usr/local && rm /tmp/cmake.tar.gz"] diff --git a/.github/workflows/linux_arm.yml b/.github/workflows/linux_arm.yml index 107558c..4ba2ad3 100644 --- a/.github/workflows/linux_arm.yml +++ b/.github/workflows/linux_arm.yml @@ -11,16 +11,17 @@ on: jobs: build: name: Linux ARMv7 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 + env: + CROSS_CONFIG: .github/cross.toml strategy: matrix: clang: [["17.0", "clang_17_0"]] # Update this to the latest Clang version if needed steps: - name: Checkout repository code - uses: actions/checkout@v4 # Updated to the latest version of the checkout action - # LLVM and Clang Installation + uses: actions/checkout@v7 - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1.1.0 # Check for the latest version available + uses: KyleMayes/install-llvm-action@v2 with: version: ${{ matrix.clang[0] }} directory: ${{ runner.temp }}/llvm-${{ matrix.clang[0] }} @@ -31,15 +32,11 @@ jobs: sudo ldconfig # Install Rust - name: Install Rust - uses: actions-rs/toolchain@v1 # Ensure this is the latest release + uses: dtolnay/rust-toolchain@master with: toolchain: stable - target: armv7-unknown-linux-gnueabihf - override: true - # Build + targets: armv7-unknown-linux-gnueabihf + - name: Install cross + run: cargo install cross --locked --version 0.2.5 - name: Build - uses: actions-rs/cargo@v1.1.0 # Use a specific latest version if available - with: - use-cross: true - command: build - args: --target armv7-unknown-linux-gnueabihf + run: cross build --target armv7-unknown-linux-gnueabihf diff --git a/.github/workflows/linux_intel.yml b/.github/workflows/linux_intel.yml index 63e3747..b9d15e9 100644 --- a/.github/workflows/linux_intel.yml +++ b/.github/workflows/linux_intel.yml @@ -16,15 +16,16 @@ jobs: fail-fast: false matrix: include: - - { rust: stable, os: ubuntu-latest } + - { rust: stable, os: ubuntu-24.04 } steps: - name: Checkout repository code - uses: actions/checkout@v2 + uses: actions/checkout@v7 - name: Install dependencies run: | sudo apt install -y cmake libclang-dev libc++-dev gcc-multilib - - name: buid - uses: actions-rs/cargo@v1 + - name: Install Rust ${{ matrix.rust }} + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - command: build \ No newline at end of file + - name: buid + run: cargo build