Skip to content

Commit

Permalink
Run Cippy on macOS and Windows; check rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonweeks committed Nov 29, 2023
1 parent 94538ac commit 304b3c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,28 @@ jobs:
- uses: EmbarkStudios/cargo-deny-action@1e59595bed8fc55c969333d08d7817b36888f0c5 # v1.5.5

clippy:
name: clippy
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v1.2.0
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: stable
components: rustfmt, clippy
components: clippy
- run: cargo clippy -- -D warnings

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v1.2.0
- uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt -- --check

integration-macos-ssh:
name: macos ssh
runs-on: macos-latest
Expand Down
10 changes: 5 additions & 5 deletions native-pkcs11-keychain/src/bin/signedtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn key_lifecycle() -> Result<(), native_pkcs11_keychain::Error> {
let generated_key = apple_security_framework::key::SecKey::generate(args)?;

if generated_key.external_representation().is_some() {
return Err("expected enclave key to not be exportable")?;
Err("expected enclave key to not be exportable")?;
}

let generated_pubkey = generated_key
Expand All @@ -65,7 +65,7 @@ fn key_lifecycle() -> Result<(), native_pkcs11_keychain::Error> {
.load_refs(true)
.search()?;
if results.is_empty() {
return Err("expected to find key, but no keys found")?;
Err("expected to find key, but no keys found")?;
}

let found_key = match results.get(0).ok_or("no key found")? {
Expand All @@ -83,7 +83,7 @@ fn key_lifecycle() -> Result<(), native_pkcs11_keychain::Error> {
.to_vec();

if generated_pubkey != found_pubkey {
return Err("pubkeys not equal")?;
Err("pubkeys not equal")?;
}

let test_payload = &random_label();
Expand All @@ -100,7 +100,7 @@ fn key_lifecycle() -> Result<(), native_pkcs11_keychain::Error> {
&signature,
)?
{
return Err("signature verification failed")?;
Err("signature verification failed")?;
}

let cert =
Expand All @@ -121,7 +121,7 @@ fn key_lifecycle() -> Result<(), native_pkcs11_keychain::Error> {
}
}
if !found {
return Err("didn't find matching cert")?;
Err("didn't find matching cert")?;
}

cert.delete()?;
Expand Down

0 comments on commit 304b3c1

Please sign in to comment.