From 7ae386285de36d87bf5801c6fb425ef68a8d1b66 Mon Sep 17 00:00:00 2001 From: Saber Haj Rabiee Date: Fri, 2 May 2025 07:27:45 -0700 Subject: [PATCH] chore: improve the autofix ci workflow --- .github/workflows/autofix.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 658b5090c..498868fed 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -26,28 +26,14 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libglib2.0-dev + - name: Install cargo-all-features + run: cargo install --git https://github.com/sabify/cargo-all-features --branch arbitrary-command-support - name: Install jq run: sudo apt-get install jq - - run: | - echo "Formatting the workspace" - cargo fmt --all - - echo "Running Clippy against each member's features (default features included)" - for member in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | .name'); do - echo "Working on member $member": - echo -e "\tdefault-features/no-features:" - # this will also run on members with no features or default features - cargo clippy --allow-dirty --fix --lib --package "$member" - - features=$(cargo metadata --no-deps --format-version 1 | jq -r ".packages[] | select(.name == \"$member\") | .features | keys[]") - for feature in $features; do - if [ "$feature" = "default" ]; then - continue - fi - echo -e "\tfeature $feature" - cargo clippy --allow-dirty --fix --lib --package "$member" --features "$feature" - done - done + - name: Format the workspace + run: cargo fmt --all + - name: Clippy the workspace + run: cargo all-features clippy --allow-dirty --fix --lib --no-deps - uses: autofix-ci/action@v1.3.1 if: ${{ always() }} with: