diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d323b30..a09182b 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" @@ -66,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