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

chore(ci): add rust toolchain to ci environments #9235

Merged
merged 8 commits into from
May 20, 2024
8 changes: 8 additions & 0 deletions .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ commands:
# Make sure we install and run riot on Python 3
- run: pip3 install riot==0.19.0

setup_rust:
description: "Install rust toolchain"
steps:
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
- run: echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> "$BASH_ENV"

setup_hatch:
description: "Install hatch"
steps:
Expand Down Expand Up @@ -1324,13 +1330,15 @@ jobs:
executor: python310
steps:
- checkout
- setup_rust
- setup_hatch
- run: hatch run slotscheck:_

conftests:
executor: python310
steps:
- checkout
- setup_rust
- setup_hatch
- run: hatch run meta-testing:meta-testing

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp312*'
cibw_prerelease_pythons: 'True'

build_sdist:
name: Build source distribution
Expand All @@ -58,15 +57,14 @@ jobs:
# Include all history and tags
with:
fetch-depth: 0

- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.7'

- name: Build sdist
run: |
pip install cython cmake
pip install "setuptools_scm[toml]>=4" "cython" "cmake>=3.24.2,<3.28" "setuptools-rust"
python setup.py sdist
- uses: actions/upload-artifact@v4
with:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/build_python_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ jobs:
CIBW_SKIP: ${{ inputs.cibw_skip }}
CIBW_PRERELEASE_PYTHONS: ${{ inputs.cibw_prerelease_pythons }}
CMAKE_BUILD_PARALLEL_LEVEL: 12
CIBW_MUSLLINUX_I686_IMAGE: ghcr.io/datadog/dd-trace-py/pypa_musllinux_1_2_i686:latest
CIBW_BEFORE_ALL: >
if [[ "$(uname -m)-$(uname -i)-$(uname -o | tr '[:upper:]' '[:lower:]')-$(ldd --version 2>&1 | head -n 1 | awk '{print $1}')" != "i686-unknown-linux-musl" ]];
then
curl -sSf https://sh.rustup.rs | sh -s -- -y;
fi
CIBW_BEFORE_ALL_WINDOWS: rustup target add i686-pc-windows-msvc
CIBW_BEFORE_ALL_MACOS: rustup target add aarch64-apple-darwin
CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
mkdir ./tempwheelhouse &&
unzip -l {wheel} | grep '\.so' &&
Expand Down Expand Up @@ -100,6 +109,15 @@ jobs:
CIBW_SKIP: ${{ inputs.cibw_skip }}
CIBW_PRERELEASE_PYTHONS: ${{ inputs.cibw_prerelease_pythons }}
CMAKE_BUILD_PARALLEL_LEVEL: 12
CIBW_MUSLLINUX_I686_IMAGE: ghcr.io/datadog/dd-trace-py/pypa_musllinux_1_2_i686:latest
CIBW_BEFORE_ALL: >
if [[ "$(uname -m)-$(uname -i)-$(uname -o | tr '[:upper:]' '[:lower:]')-$(ldd --version 2>&1 | head -n 1 | awk '{print $1}')" != "i686-unknown-linux-musl" ]];
then
curl -sSf https://sh.rustup.rs | sh -s -- -y;
fi
CIBW_BEFORE_ALL_WINDOWS: rustup target add i686-pc-windows-msvc
CIBW_BEFORE_ALL_MACOS: rustup target add aarch64-apple-darwin
CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
mkdir ./tempwheelhouse &&
unzip -l {wheel} | grep '\.so' &&
Expand Down
Loading