From b14e2c77f7f5134abd4283b8efa6096fb58761cb Mon Sep 17 00:00:00 2001 From: xqtc Date: Tue, 3 Sep 2024 22:08:44 +0200 Subject: [PATCH] Add workflows --- .forgejo/workflows/uwu.yaml | 44 +++++++++++++++++++++++++++++++++++++ lib-uwusched/src/lib.rs | 14 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .forgejo/workflows/uwu.yaml diff --git a/.forgejo/workflows/uwu.yaml b/.forgejo/workflows/uwu.yaml new file mode 100644 index 0000000..2f8bdee --- /dev/null +++ b/.forgejo/workflows/uwu.yaml @@ -0,0 +1,44 @@ +on: + push: + branches: [main] +jobs: + build: + runs-on: ubuntu-latest + steps: + - id: checkout + name: checkout + uses: actions/checkout@v4 + - uses: https://github.com/actions-rs/toolchain@v1 + with: + toolchain: nightly + - uses: https://github.com/actions-rs/cargo@v1 + with: + command: build + args: --release --bin uwusched + - uses: https://github.com/actions-rs/cargo@v1 + with: + command: build + args: --release --lib lib-uwusched + # - uses: https://github.com/actions-rs/cargo@v1 + # with: + # command: test + # args: --lib + clippy: + runs-on: ubuntu-latest + steps: + - id: checkout + name: checkout + uses: actions/checkout@v4 + - uses: https://github.com/actions-rs/toolchain@v1 + with: + toolchain: nightly + - uses: https://github.com/actions-rs/cargo@v1 + with: + command: clippy + args: --fix --lib --bin + - id: commit + name: commit + uses: https://github.com/EndBug/add-and-commit@v9 + with: + author_name: "[Clippy]" + diff --git a/lib-uwusched/src/lib.rs b/lib-uwusched/src/lib.rs index e69de29..b93cf3f 100644 --- a/lib-uwusched/src/lib.rs +++ b/lib-uwusched/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}