Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dependabot and CI #1

Merged
merged 3 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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