From 633b86ddc43cc36d4b1a86c20204cd8304ca630e Mon Sep 17 00:00:00 2001 From: Skgland Date: Mon, 18 Aug 2025 20:53:02 +0200 Subject: [PATCH] make CI read msrv from Cargo.toml instead of hardcoding it, so we have a single source of truth --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36a0f15e..1932143e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,20 @@ jobs: run: cargo clippy --no-deps --all-targets if: ${{ !cancelled() }} + read-msrv: + runs-on: ubuntu-22.04 + outputs: + msrv: ${{ steps.read-declared-msrv.outputs.msrv }} + steps: + - uses: actions/checkout@v4 + - id: read-declared-msrv + name: Read msrv from Cargo.toml rust_version field + run: echo "msrv=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name = "scryer-prolog") | ."rust_version"')" >> "$GITHUB_OUTPUT" + + build-test: runs-on: ${{ matrix.os }} + needs: [read-msrv] strategy: fail-fast: false matrix: @@ -49,7 +61,7 @@ jobs: # FIXME(issue #2138): run wasm tests, failing to run since https://github.com/mthom/scryer-prolog/pull/2137 removed wasm-pack - { os: ubuntu-22.04, rust-version: nightly, target: 'wasm32-unknown-unknown', publish: true, args: '--no-default-features' , test-args: '--no-run --no-default-features', use_swap: true } # Cargo.toml rust-version - - { os: ubuntu-22.04, rust-version: "1.87", target: 'x86_64-unknown-linux-gnu'} + - { os: ubuntu-22.04, rust-version: "${{ needs.read-msrv.outputs.msrv }}" , target: 'x86_64-unknown-linux-gnu'} - { os: ubuntu-22.04, rust-version: beta, target: 'x86_64-unknown-linux-gnu'} - { os: ubuntu-22.04, rust-version: nightly, target: 'x86_64-unknown-linux-gnu', miri: true, components: "miri"} defaults: -- 2.54.0