From 65c4fd2fecc9dbb01e29753ba2b9969dec1c8a4d Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 19 Jul 2024 18:22:21 +0200 Subject: [PATCH 1/4] Add lint checks & change actions-rs/toolchain to dtolnay/rust-toolchain --- .github/workflows/linutil.yml | 6 ++---- .github/workflows/rust.yml | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linutil.yml b/.github/workflows/linutil.yml index 34ce5d4c..30f7f8ad 100644 --- a/.github/workflows/linutil.yml +++ b/.github/workflows/linutil.yml @@ -30,13 +30,11 @@ jobs: key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-index- - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: Build run: cargo build --target-dir=build --release --verbose - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Commit Linutil file_pattern: 'build/release/linutil' - if: success() \ No newline at end of file + if: success() diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 471af03f..a61e9fe3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: Rust Check +name: Rust Checks on: pull_request: @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout sources - uses: actions/checkout@v4 - name: Cache Cargo registry uses: actions/cache@v4 @@ -26,8 +27,19 @@ jobs: key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-index- - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: Build - run: cargo check \ No newline at end of file + run: cargo check + + lints: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + - uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - name: Run cargo fmt + run: cargo --fmt --all check + - name: Run cargo clippy + run: cargo clippy From c3e49ce6cd7196720d87270b3649c58ba2596d4d Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 19 Jul 2024 18:25:59 +0200 Subject: [PATCH 2/4] typo --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a61e9fe3..543f3739 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,6 +40,6 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - name: Run cargo fmt - run: cargo --fmt --all check + run: cargo fmt --all --check - name: Run cargo clippy run: cargo clippy From 4eb22275f08574f1f37b095a7b97467ea90fd505 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 19 Jul 2024 18:30:46 +0200 Subject: [PATCH 3/4] add newlines --- .github/workflows/rust.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 543f3739..35f75983 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,20 +14,24 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v4 + - name: Cache Cargo registry uses: actions/cache@v4 with: path: ~/.cargo/registry key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-registry- + - name: Cache Cargo index uses: actions/cache@v4 with: path: ~/.cargo/git key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo-index- + - name: Install Rust uses: dtolnay/rust-toolchain@stable + - name: Build run: cargo check @@ -37,9 +41,12 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v4 + - name: Install Rust uses: dtolnay/rust-toolchain@stable + - name: Run cargo fmt run: cargo fmt --all --check + - name: Run cargo clippy run: cargo clippy From 9df2a8e274fca91be62dfd2e6a8d94a9cbcf4f04 Mon Sep 17 00:00:00 2001 From: Adam Perkowski Date: Fri, 19 Jul 2024 18:45:13 +0200 Subject: [PATCH 4/4] Added names and fixed all typos i made --- .github/workflows/rust.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 35f75983..0b2e12a4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,11 +9,12 @@ env: jobs: cargo_check: + name: Cargo Check runs-on: ubuntu-latest steps: - name: Checkout sources - - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Cache Cargo registry uses: actions/cache@v4 @@ -36,11 +37,12 @@ jobs: run: cargo check lints: + name: Lints runs-on: ubuntu-latest steps: - name: Checkout sources - - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Install Rust uses: dtolnay/rust-toolchain@stable