ci: check minimal-versions on MSRV feature powerset (#4273)
* ci: check minimal-versions on MSRV feature powerset * fix msrv arg * bump num-bigint floor to 0.4.2 * try fix build syntax
This commit is contained in:
parent
1279232701
commit
c7c1dff710
|
@ -16,6 +16,9 @@ on:
|
||||||
rust-target:
|
rust-target:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
MSRV:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -51,9 +54,9 @@ jobs:
|
||||||
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
|
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
|
||||||
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV
|
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV
|
||||||
|
|
||||||
- if: inputs.rust == '1.63.0'
|
- if: inputs.rust == inputs.MSRV
|
||||||
name: Prepare minimal package versions (MSRV only)
|
name: Prepare MSRV package versions
|
||||||
run: nox -s set-minimal-package-versions
|
run: nox -s set-msrv-package-versions
|
||||||
|
|
||||||
- if: inputs.rust != 'stable'
|
- if: inputs.rust != 'stable'
|
||||||
name: Ignore changed error messages when using trybuild
|
name: Ignore changed error messages when using trybuild
|
||||||
|
|
|
@ -31,6 +31,18 @@ jobs:
|
||||||
- name: Check rust formatting (rustfmt)
|
- name: Check rust formatting (rustfmt)
|
||||||
run: nox -s rustfmt
|
run: nox -s rustfmt
|
||||||
|
|
||||||
|
resolve:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
MSRV: ${{ steps.resolve-msrv.outputs.MSRV }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
- name: resolve MSRV
|
||||||
|
id: resolve-msrv
|
||||||
|
run:
|
||||||
|
echo MSRV=`python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["rust-version"])'` >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
semver-checks:
|
semver-checks:
|
||||||
if: github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
needs: [fmt]
|
needs: [fmt]
|
||||||
|
@ -41,13 +53,13 @@ jobs:
|
||||||
- uses: obi1kenobi/cargo-semver-checks-action@v2
|
- uses: obi1kenobi/cargo-semver-checks-action@v2
|
||||||
|
|
||||||
check-msrv:
|
check-msrv:
|
||||||
needs: [fmt]
|
needs: [fmt, resolve]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: 1.63.0
|
toolchain: ${{ needs.resolve.outputs.MSRV }}
|
||||||
targets: x86_64-unknown-linux-gnu
|
targets: x86_64-unknown-linux-gnu
|
||||||
components: rust-src
|
components: rust-src
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
|
@ -57,9 +69,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.event_name != 'merge_group' }}
|
save-if: ${{ github.event_name != 'merge_group' }}
|
||||||
- run: python -m pip install --upgrade pip && pip install nox
|
- run: python -m pip install --upgrade pip && pip install nox
|
||||||
- name: Prepare minimal package versions
|
# This is a smoke test to confirm that CI will run on MSRV (including dev dependencies)
|
||||||
run: nox -s set-minimal-package-versions
|
- name: Check with MSRV package versions
|
||||||
- run: nox -s check-all
|
run: |
|
||||||
|
nox -s set-msrv-package-versions
|
||||||
|
nox -s check-all
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
|
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
|
||||||
|
@ -141,7 +155,7 @@ jobs:
|
||||||
build-pr:
|
build-pr:
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-build-full') && github.event_name == 'pull_request' }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-build-full') && github.event_name == 'pull_request' }}
|
||||||
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
|
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
|
||||||
needs: [fmt]
|
needs: [fmt, resolve]
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.platform.os }}
|
os: ${{ matrix.platform.os }}
|
||||||
|
@ -149,6 +163,7 @@ jobs:
|
||||||
python-architecture: ${{ matrix.platform.python-architecture }}
|
python-architecture: ${{ matrix.platform.python-architecture }}
|
||||||
rust: ${{ matrix.rust }}
|
rust: ${{ matrix.rust }}
|
||||||
rust-target: ${{ matrix.platform.rust-target }}
|
rust-target: ${{ matrix.platform.rust-target }}
|
||||||
|
MSRV: ${{ needs.resolve.outputs.MSRV }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
strategy:
|
strategy:
|
||||||
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
||||||
|
@ -198,7 +213,7 @@ jobs:
|
||||||
build-full:
|
build-full:
|
||||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
|
||||||
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
|
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
|
||||||
needs: [fmt]
|
needs: [fmt, resolve]
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.platform.os }}
|
os: ${{ matrix.platform.os }}
|
||||||
|
@ -206,6 +221,7 @@ jobs:
|
||||||
python-architecture: ${{ matrix.platform.python-architecture }}
|
python-architecture: ${{ matrix.platform.python-architecture }}
|
||||||
rust: ${{ matrix.rust }}
|
rust: ${{ matrix.rust }}
|
||||||
rust-target: ${{ matrix.platform.rust-target }}
|
rust-target: ${{ matrix.platform.rust-target }}
|
||||||
|
MSRV: ${{ needs.resolve.outputs.MSRV }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
strategy:
|
strategy:
|
||||||
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
|
||||||
|
@ -251,7 +267,7 @@ jobs:
|
||||||
]
|
]
|
||||||
include:
|
include:
|
||||||
# Test minimal supported Rust version
|
# Test minimal supported Rust version
|
||||||
- rust: 1.63.0
|
- rust: ${{ needs.resolve.outputs.MSRV }}
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
platform:
|
platform:
|
||||||
{
|
{
|
||||||
|
@ -487,21 +503,31 @@ jobs:
|
||||||
- run: python3 -m nox -s test-version-limits
|
- run: python3 -m nox -s test-version-limits
|
||||||
|
|
||||||
check-feature-powerset:
|
check-feature-powerset:
|
||||||
needs: [fmt]
|
needs: [fmt, resolve]
|
||||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
name: check-feature-powerset ${{ matrix.rust }}
|
||||||
|
strategy:
|
||||||
|
# run on stable and MSRV to check that all combinations of features are expected to build fine on our supported
|
||||||
|
# range of compilers
|
||||||
|
matrix:
|
||||||
|
rust: ["stable"]
|
||||||
|
include:
|
||||||
|
- rust: ${{ needs.resolve.outputs.MSRV }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.event_name != 'merge_group' }}
|
save-if: ${{ github.event_name != 'merge_group' }}
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
components: rust-src
|
toolchain: stable
|
||||||
- uses: taiki-e/install-action@cargo-hack
|
- uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cargo-hack,cargo-minimal-versions
|
||||||
- run: python3 -m pip install --upgrade pip && pip install nox
|
- run: python3 -m pip install --upgrade pip && pip install nox
|
||||||
- run: python3 -m nox -s check-feature-powerset
|
- run: python3 -m nox -s check-feature-powerset -- ${{ matrix.rust != 'stable' && 'minimal-versions' || '' }}
|
||||||
|
|
||||||
test-cross-compilation:
|
test-cross-compilation:
|
||||||
needs: [fmt]
|
needs: [fmt]
|
||||||
|
|
|
@ -18,7 +18,7 @@ rust-version = "1.63"
|
||||||
cfg-if = "1.0"
|
cfg-if = "1.0"
|
||||||
libc = "0.2.62"
|
libc = "0.2.62"
|
||||||
memoffset = "0.9"
|
memoffset = "0.9"
|
||||||
once_cell = "1.13.0"
|
once_cell = "1.13"
|
||||||
|
|
||||||
# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
|
# ffi bindings to the python interpreter, split into a separate crate so they can be used independently
|
||||||
pyo3-ffi = { path = "pyo3-ffi", version = "=0.23.0-dev" }
|
pyo3-ffi = { path = "pyo3-ffi", version = "=0.23.0-dev" }
|
||||||
|
@ -32,17 +32,17 @@ unindent = { version = "0.2.1", optional = true }
|
||||||
inventory = { version = "0.3.0", optional = true }
|
inventory = { version = "0.3.0", optional = true }
|
||||||
|
|
||||||
# crate integrations that can be added using the eponymous features
|
# crate integrations that can be added using the eponymous features
|
||||||
anyhow = { version = "1.0", optional = true }
|
anyhow = { version = "1.0.1", optional = true }
|
||||||
chrono = { version = "0.4.25", default-features = false, optional = true }
|
chrono = { version = "0.4.25", default-features = false, optional = true }
|
||||||
chrono-tz = { version = ">= 0.6, < 0.10", default-features = false, optional = true }
|
chrono-tz = { version = ">= 0.6, < 0.10", default-features = false, optional = true }
|
||||||
either = { version = "1.9", optional = true }
|
either = { version = "1.9", optional = true }
|
||||||
eyre = { version = ">= 0.4, < 0.7", optional = true }
|
eyre = { version = ">= 0.4, < 0.7", optional = true }
|
||||||
hashbrown = { version = ">= 0.9, < 0.15", optional = true }
|
hashbrown = { version = ">= 0.9, < 0.15", optional = true }
|
||||||
indexmap = { version = ">= 1.6, < 3", optional = true }
|
indexmap = { version = ">= 1.6, < 3", optional = true }
|
||||||
num-bigint = { version = "0.4", optional = true }
|
num-bigint = { version = "0.4.2", optional = true }
|
||||||
num-complex = { version = ">= 0.2, < 0.5", optional = true }
|
num-complex = { version = ">= 0.2, < 0.5", optional = true }
|
||||||
num-rational = {version = "0.4.1", optional = true }
|
num-rational = {version = "0.4.1", optional = true }
|
||||||
rust_decimal = { version = "1.0.0", default-features = false, optional = true }
|
rust_decimal = { version = "1.15", default-features = false, optional = true }
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
smallvec = { version = "1.0", optional = true }
|
smallvec = { version = "1.0", optional = true }
|
||||||
|
|
||||||
|
|
10
noxfile.py
10
noxfile.py
|
@ -543,8 +543,8 @@ def check_changelog(session: nox.Session):
|
||||||
print(fragment.name)
|
print(fragment.name)
|
||||||
|
|
||||||
|
|
||||||
@nox.session(name="set-minimal-package-versions", venv_backend="none")
|
@nox.session(name="set-msrv-package-versions", venv_backend="none")
|
||||||
def set_minimal_package_versions(session: nox.Session):
|
def set_msrv_package_versions(session: nox.Session):
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
if toml is None:
|
if toml is None:
|
||||||
|
@ -708,10 +708,14 @@ def check_feature_powerset(session: nox.Session):
|
||||||
rust_flags = env.get("RUSTFLAGS", "")
|
rust_flags = env.get("RUSTFLAGS", "")
|
||||||
env["RUSTFLAGS"] = f"{rust_flags} -Dwarnings"
|
env["RUSTFLAGS"] = f"{rust_flags} -Dwarnings"
|
||||||
|
|
||||||
|
subcommand = "hack"
|
||||||
|
if "minimal-versions" in session.posargs:
|
||||||
|
subcommand = "minimal-versions"
|
||||||
|
|
||||||
comma_join = ",".join
|
comma_join = ",".join
|
||||||
_run_cargo(
|
_run_cargo(
|
||||||
session,
|
session,
|
||||||
"hack",
|
subcommand,
|
||||||
"--feature-powerset",
|
"--feature-powerset",
|
||||||
'--optional-deps=""',
|
'--optional-deps=""',
|
||||||
f'--skip="{comma_join(features_to_skip)}"',
|
f'--skip="{comma_join(features_to_skip)}"',
|
||||||
|
|
Loading…
Reference in New Issue