diff --git a/.github/scripts/setup+build-cpp-linux-fedora-container.sh b/.github/scripts/setup+build-cpp-linux-fedora-container.sh new file mode 100755 index 000000000..e93757d47 --- /dev/null +++ b/.github/scripts/setup+build-cpp-linux-fedora-container.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -ex + +# [Setup] Install dependencies inside the container. +dnf update -y +dnf install -y \ + blas-devel \ + lapack-devel \ + openblas-devel \ + make \ + cmake \ + clang \ + git +dnf clean all + +# [C++] CI Build Sanity Check: Verifies code compilation, not for release. +export CMAKE_ARGS="-DCMAKE_COMPILE_WARNING_AS_ERROR=ON" +export DEBUG=1 +export CMAKE_C_COMPILER=/usr/bin/clang +export CMAKE_CXX_COMPILER=/usr/bin/clang++ + +mkdir -p build +pushd build +cmake .. -DMLX_BUILD_METAL=OFF -DCMAKE_BUILD_TYPE=DEBUG +make -j $(nproc) +./tests/tests +popd diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 00c50e200..2cfe78e75 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -91,3 +91,24 @@ jobs: path: wheelhouse/mlx_cuda-*.whl retention-days: 7 + linux_fedora_build_cpp: + name: Linux Fedora CPP Build (${{ matrix.arch }}) + strategy: + fail-fast: false + matrix: + include: + - host: ubuntu-22.04 + arch: x86_64 + - host: ubuntu-22.04-arm + arch: aarch64 + + runs-on: ${{ matrix.host }} + container: + image: fedora:42 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: CPP Build Test - No Release + run: | + bash ./.github/scripts/setup+build-cpp-linux-fedora-container.sh diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 12c38cfc8..d86ed307e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -44,3 +44,25 @@ jobs: steps: - uses: actions/checkout@v5 - uses: ./.github/actions/build-docs + + linux_fedora_build_cpp: + name: Linux Fedora CPP Build (${{ matrix.arch }}) + strategy: + fail-fast: false + matrix: + include: + - host: ubuntu-22.04 + arch: x86_64 + - host: ubuntu-22.04-arm + arch: aarch64 + + runs-on: ${{ matrix.host }} + container: + image: fedora:42 + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: CPP Build Test - No Release + run: | + bash ./.github/scripts/setup+build-cpp-linux-fedora-container.sh