]> Repositorios git - scryer-prolog.git/commitdiff
check individual features in CI
authorSkgland <[email protected]>
Mon, 27 Apr 2026 20:53:05 +0000 (22:53 +0200)
committerBennet Bleßmann <[email protected]>
Sun, 24 May 2026 21:00:27 +0000 (23:00 +0200)
.github/workflows/check_features.sh [new file with mode: 0755]
.github/workflows/ci.yml

diff --git a/.github/workflows/check_features.sh b/.github/workflows/check_features.sh
new file mode 100755 (executable)
index 0000000..8dbb153
--- /dev/null
@@ -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
index ff0993a2299d9dbac0bdebebda6ff34552d8e646..9fbb2f1e58ce24319c88db88963566826e9a20a2 100644 (file)
@@ -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 }}