From 6150ca90d313635e3e066b6e363ca86b8cff8178 Mon Sep 17 00:00:00 2001 From: Skgland Date: Mon, 27 Apr 2026 22:53:05 +0200 Subject: [PATCH] check individual features in CI --- .github/workflows/check_features.sh | 12 ++++++++++++ .github/workflows/ci.yml | 11 ++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 .github/workflows/check_features.sh diff --git a/.github/workflows/check_features.sh b/.github/workflows/check_features.sh new file mode 100755 index 00000000..8dbb1537 --- /dev/null +++ b/.github/workflows/check_features.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +echo "Checking all feature at once" +cargo check -q --all-targets --all-features "$@" + +features=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name = "scryer-prolog") | .features | keys | join(" ")') + +for feature in ${features} ; do + echo "Checking feature ${feature} in isolation" + cargo check -q --all-targets --no-default-features --features=${feature} "$@" +done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff0993a2..9fbb2f1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,10 +53,10 @@ jobs: matrix: include: # operating systems - - { os: windows-latest, rust-version: stable, target: 'x86_64-pc-windows-msvc', publish: true } - - { os: macos-latest, rust-version: stable, target: 'x86_64-apple-darwin', publish: true } + - { os: windows-latest, rust-version: stable, target: 'x86_64-pc-windows-msvc', publish: true, check-features: true } + - { os: macos-latest, rust-version: stable, target: 'x86_64-apple-darwin', publish: true, check-features: true } # architectures - - { os: ubuntu-22.04, rust-version: stable, target: 'x86_64-unknown-linux-gnu', publish: true } + - { os: ubuntu-22.04, rust-version: stable, target: 'x86_64-unknown-linux-gnu', publish: true, check-features: true } - { os: ubuntu-22.04, rust-version: stable, target: 'i686-unknown-linux-gnu', publish: true } # 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 } @@ -88,9 +88,14 @@ jobs: # Build and test. - name: Build library run: cargo build --all-targets --target ${{ matrix.target }} ${{ matrix.args }} --verbose + - name: Test run: cargo test --target ${{ matrix.target }} ${{ matrix.test-args }} --all + - name: Check features + if: matrix.check-features + run: bash ./.github/workflows/check_features.sh --target ${{ matrix.target }} + - name: Check miri if: matrix.miri run: cargo miri test --target ${{ matrix.target }} ${{ matrix.args }} -- 2.54.0