From a2f083460201053201abb4f9087964ef902d3605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 29 Jun 2025 13:34:47 +0200 Subject: [PATCH 1/5] Add CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .forgejo/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .forgejo/workflows/ci.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..00ee511 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,22 @@ +name: Cargo Build & Test + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + build_and_test: + name: hem - Build & Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + uses: https://github.com/dtolnay/rust-toolchain@1.88 + - run: cargo clippy -- -D warnings + - run: cargo build --verbose + - run: cargo test --verbose From 3df3a636dd4717a05714b612c97bf3e32f1e0aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 29 Jun 2025 14:05:51 +0200 Subject: [PATCH 2/5] Allow unused items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 21a1e04..56de207 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![expect(dead_code)] + use clap::Parser; mod cli; @@ -5,10 +7,10 @@ mod expr; fn main() -> miette::Result<()> { let args = cli::Args::parse(); - let input_delim = args.delimiter(); - let input = args.input(); + let _input_delim = args.delimiter(); + let _input = args.input(); - let expression = expr::parse(&args.expression)?; + let _expression = expr::parse(&args.expression)?; Ok(()) } From a661f047a643dcfa30110350b7517f55bf5698ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 29 Jun 2025 14:07:16 +0200 Subject: [PATCH 3/5] Add formatting job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .forgejo/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 00ee511..d926944 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -10,6 +10,16 @@ env: CARGO_TERM_COLOR: always jobs: + formatting: + name: hem - Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + uses: https://github.com/dtolnay/rust-toolchain@1.88 + with: + components: rustfmt + - run: cargo fmt --check build_and_test: name: hem - Build & Test runs-on: ubuntu-latest From 7bd3610c5cabc91ef9ab81f21ba7d85dee3175e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 29 Jun 2025 14:08:22 +0200 Subject: [PATCH 4/5] Add caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .forgejo/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index d926944..416fb30 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -27,6 +27,16 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@1.88 + with: + components: clippy + - name: ⚡ Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - run: cargo clippy -- -D warnings - run: cargo build --verbose - run: cargo test --verbose From b82764b51826a4a69864cef3479913c4eed0e022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Sun, 29 Jun 2025 14:18:51 +0200 Subject: [PATCH 5/5] Add cachekey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .forgejo/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 416fb30..cb7824c 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust uses: https://github.com/dtolnay/rust-toolchain@1.88 + id: toolchain with: components: clippy - name: ⚡ Cache @@ -36,7 +37,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - run: cargo clippy -- -D warnings + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ steps.toolchain.outputs.cachekey }} + - run: cargo clippy --all-targets -- -D warnings - run: cargo build --verbose - run: cargo test --verbose