From f5cbe46ac31698e8ef0bba787ebe92aea0ae0b59 Mon Sep 17 00:00:00 2001 From: valeratrades Date: Sat, 24 Aug 2024 12:45:53 +0000 Subject: [PATCH 1/5] feat: ga: sorted and unused deps --- .github/workflows/style.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/style.yml diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..d023afc6 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,43 @@ +name: Rust Style + +on: [push] + +env: + CARGO_TERM_COLOR: always + +jobs: + sort: + name: Cargo Sorted + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-sort + run: | + cargo install cargo-sort + + - name: Check if Cargo.toml is sorted + run: | + cargo sort -wc + exit_code=$? + if [ $exit_code != 0 ]; then + echo "Cargo.toml is not sorted. Run `cargo sort -w` to fix it." + exit $exit_code + fi + + machete: + name: Cargo Machete + runs-on: ubuntu-latest + + steps: + - name: Install cargo-machete + run: | + cargo install cargo-machete + + - name: Check for unused dependencies + run: | + cargo machete + exit_code=$? + if [ $exit_code != 0 ]; then + echo "Found unused dependencies. Run `cargo machete` locally and remove the matches or include them to ignored." + exit $exit_code + fi From 52573e79a2ff38be2132eb665f5d88b088942505 Mon Sep 17 00:00:00 2001 From: valeratrades Date: Sat, 24 Aug 2024 14:04:20 +0000 Subject: [PATCH 2/5] fixup! --- .github/workflows/style.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index d023afc6..2248b3cc 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -7,22 +7,22 @@ env: jobs: sort: - name: Cargo Sorted - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-sort - run: | - cargo install cargo-sort + name: Cargo Sorted + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-sort + run: | + cargo install cargo-sort - - name: Check if Cargo.toml is sorted - run: | - cargo sort -wc - exit_code=$? - if [ $exit_code != 0 ]; then - echo "Cargo.toml is not sorted. Run `cargo sort -w` to fix it." - exit $exit_code - fi + - name: Check if Cargo.toml is sorted + run: | + cargo sort -wc + exit_code=$? + if [ $exit_code != 0 ]; then + echo "Cargo.toml is not sorted. Run `cargo sort -w` to fix it." + exit $exit_code + fi machete: name: Cargo Machete From 80e3ee78f45464425626e96b835a44f3be3402d2 Mon Sep 17 00:00:00 2001 From: valeratrades Date: Sat, 24 Aug 2024 14:08:38 +0000 Subject: [PATCH 3/5] fixup! --- .github/workflows/style.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 2248b3cc..ae8883ed 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -29,15 +29,16 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install cargo-machete - run: | - cargo install cargo-machete + - uses: actions/checkout@v4 + - name: Install cargo-machete + run: | + cargo install cargo-machete - - name: Check for unused dependencies - run: | - cargo machete - exit_code=$? - if [ $exit_code != 0 ]; then - echo "Found unused dependencies. Run `cargo machete` locally and remove the matches or include them to ignored." - exit $exit_code - fi + - name: Check for unused dependencies + run: | + cargo machete + exit_code=$? + if [ $exit_code != 0 ]; then + echo "Found unused dependencies. Run `cargo machete` locally and remove the matches or include them to ignored." + exit $exit_code + fi From 870f58a7c07814d84642ea981c5b4a8d9285f3ba Mon Sep 17 00:00:00 2001 From: valeratrades Date: Sat, 24 Aug 2024 15:42:18 +0000 Subject: [PATCH 4/5] fix: remove `cargo-sort`, as it would require synchronizing commit hooks (will add back some time later) --- .github/workflows/style.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index ae8883ed..1e301bc4 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -6,24 +6,6 @@ env: CARGO_TERM_COLOR: always jobs: - sort: - name: Cargo Sorted - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install cargo-sort - run: | - cargo install cargo-sort - - - name: Check if Cargo.toml is sorted - run: | - cargo sort -wc - exit_code=$? - if [ $exit_code != 0 ]; then - echo "Cargo.toml is not sorted. Run `cargo sort -w` to fix it." - exit $exit_code - fi - machete: name: Cargo Machete runs-on: ubuntu-latest From 4a91ae2a2f9a7cad169dd45a7b2a034b242d39b3 Mon Sep 17 00:00:00 2001 From: valeratrades Date: Sat, 24 Aug 2024 15:50:38 +0000 Subject: [PATCH 5/5] fixup! --- .github/workflows/style.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 1e301bc4..03b5ce0b 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -12,15 +12,5 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install cargo-machete - run: | - cargo install cargo-machete - - name: Check for unused dependencies - run: | - cargo machete - exit_code=$? - if [ $exit_code != 0 ]; then - echo "Found unused dependencies. Run `cargo machete` locally and remove the matches or include them to ignored." - exit $exit_code - fi + uses: bnjbvr/cargo-machete@main