diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e69558..5cb8306 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,11 +33,11 @@ jobs: - name: Installing ubuntu requirements if: ${{startsWith(matrix.os, 'ubuntu')}} run: - sudo apt-get install -y --no-install-recommends clang libeigen3-dev + scripts/ubuntu_dependencies.sh - name: Installing macos requirements if: ${{startsWith(matrix.os, 'macos')}} run: - brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 + scripts/macos_dependencies.sh - name: Building run: scons -j$(nproc || sysctl -n hw.logicalcpu) @@ -55,11 +55,11 @@ jobs: - name: Installing ubuntu requirements if: ${{startsWith(matrix.os, 'ubuntu')}} run: - sudo apt-get install -y --no-install-recommends clang libeigen3-dev + scripts/ubuntu_dependencies.sh - name: Installing macos requirements if: ${{startsWith(matrix.os, 'macos')}} run: - brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13 + scripts/macos_dependencies.sh - name: Installing rednose run: pip install -e .[dev] - name: Running all tests diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 59b7095..a2ae3bb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,7 +28,24 @@ jobs: CIBW_BUILD: "${{ matrix.python.cp }}-${{ matrix.platform.target }}" CIBW_ARCHS: "${{ matrix.platform.arch }}" CIBW_BEFORE_ALL_LINUX: "dnf install -y clang libffi-devel eigen3-devel python${{ matrix.python.py }}-devel" - CIBW_BEFORE_BUILD_MACOS: "brew install eigen && brew install --cask gcc-arm-embedded && brew install gcc@13" + CIBW_BEFORE_BUILD_MACOS: {project}/scripts/macos_dependencies.sh CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux_2_28" CIBW_TEST_COMMAND: pip install -r {project}/requirements.txt && pytest {package} + + + - uses: actions/setup-python@v5 + if: ${{ matrix.platform.arch }} != 'aarch64' + with: + python-version: ${{ matrix.python.py }} + + - name: Installing the wheel + if: ${{ matrix.platform.arch }} != 'aarch64' + run: | + pip install --break-system-packages ./wheelhouse/*.whl + + - name: Saving wheel + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.platform.target }}-${{ matrix.python.cp }} + path: ./wheelhouse/*.whl diff --git a/scripts/build_wheel.sh b/scripts/build_wheel.sh deleted file mode 100755 index b4d9394..0000000 --- a/scripts/build_wheel.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -cd $DIR/.. - -export CIBW_BUILD="cp312-manylinux_x86_64 cp311-manylinux_x86_64" -export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux_2_28_x86_64" -export CIBW_BEFORE_ALL_LINUX="dnf install -y clang libffi-devel eigen3-devel" - -cibuildwheel diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh deleted file mode 100755 index d7f109b..0000000 --- a/scripts/install_dependencies.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -cd $DIR - -SUDO="" - -# Use sudo if not root -if [[ ! $(id -u) -eq 0 ]]; then - if [[ -z $(which sudo) ]]; then - echo "Please install sudo or run as root" - exit 1 - fi - SUDO="sudo" -fi - -$SUDO apt-get update -$SUDO apt-get install -y --no-install-recommends python3 python3-pip clang libeigen3-dev diff --git a/scripts/macos_dependencies.sh b/scripts/macos_dependencies.sh new file mode 100755 index 0000000..10534fc --- /dev/null +++ b/scripts/macos_dependencies.sh @@ -0,0 +1,6 @@ +#!/bin/bash +brew bundle --file=- <<-EOS +brew "eigen" +cask "gcc-arm-embedded" +brew "gcc@13" +EOS diff --git a/scripts/ubuntu_dependencies.sh b/scripts/ubuntu_dependencies.sh new file mode 100755 index 0000000..652f236 --- /dev/null +++ b/scripts/ubuntu_dependencies.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +if [[ ! $(id -u) -eq 0 ]]; then + if [[ -z $(which sudo) ]]; then + echo "Please install sudo or run as root" + exit 1 + fi + SUDO="sudo" +fi + +$SUDO apt-get update +$SUDO apt-get install -y --no-install-recommends clang libeigen3-dev