Skip to content

Commit

Permalink
Merge pull request #1 from triarius/dependabot-and-ci
Browse files Browse the repository at this point in the history
Add Dependabot and CI
  • Loading branch information
triarius authored Aug 31, 2024
2 parents feff5e9 + b1ee112 commit 7bb9c5c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
- push
name: CI
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --verbose
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --verbose --all --check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test -- --nocapture
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ where
}

/// Get the PIN using the walker binary
///
/// # Errors
/// Errors
pub fn walker_get_pin(_state: &State) -> std::result::Result<String, GetPinError> {
std::process::Command::new("walker")
.arg("--password")
Expand All @@ -200,6 +203,9 @@ pub fn walker_get_pin(_state: &State) -> std::result::Result<String, GetPinError
}

/// Listen for Assuan requests and respond to them
///
/// # Errors
/// Errors
pub fn listen<F>(input: impl BufRead, output: &mut impl Write, get_pin: F) -> Result<()>
where
F: Fn(&State) -> std::result::Result<String, GetPinError> + Copy,
Expand Down Expand Up @@ -239,6 +245,7 @@ mod test {
use super::listen;
use indoc::indoc;

#[allow(clippy::unnecessary_wraps)]
fn get_pin(_state: &super::State) -> std::result::Result<String, super::GetPinError> {
Ok("1234".to_string())
}
Expand Down

0 comments on commit 7bb9c5c

Please sign in to comment.