From 049b51b5a747b924799bd955fb6b65ac4f8da934 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Thu, 20 Mar 2025 19:45:07 +0000 Subject: [PATCH 1/2] ci: resolve MSRV from Cargo.toml --- .github/workflows/ci.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d323b30..cc7a2d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,19 @@ env: CARGO_TERM_COLOR: always jobs: + resolve: + runs-on: ubuntu-latest + outputs: + MSRV: ${{ steps.resolve-msrv.outputs.MSRV }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - 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 + fmt: runs-on: ubuntu-latest steps: @@ -30,7 +43,7 @@ jobs: - run: cargo clippy --all build: - needs: [fmt] # don't wait for clippy as fails rarely and takes longer + needs: [resolve, fmt] # don't wait for clippy as fails rarely and takes longer name: python${{ matrix.python-version }} ${{ matrix.os }} rust-${{ matrix.rust}} runs-on: ${{ matrix.os }} strategy: @@ -43,7 +56,7 @@ jobs: include: - python-version: "3.13" os: "ubuntu-latest" - rust: "1.63" + rust: ${{ needs.resolve.outputs.MSRV }} - python-version: "3.13" python-architecture: "arm64" os: "macos-latest" From f50bdadb4cc32c0e721d6868dfca872caab56fc6 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Thu, 20 Mar 2025 20:19:15 +0000 Subject: [PATCH 2/2] downgrade dependencies for MSRV compatibility --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc7a2d3..a09182b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,12 @@ jobs: - uses: Swatinem/rust-cache@v2 continue-on-error: true + - if: ${{ matrix.rust == needs.resolve.outputs.MSRV }} + name: Set dependencies on MSRV + run: cargo +stable update + env: + CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback + - name: Test run: cargo test --verbose