diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab6d8e9a..e63b5dcd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: env: RUST_BACKTRACE: 1 + CARGO_PROFILE_DEV_DEBUG: 0 jobs: test: @@ -26,7 +27,8 @@ jobs: with: toolchain: ${{ matrix.rust }} - - uses: actions/cache@v5 + - uses: actions/cache/restore@v5 + name: Cache crates.io with: path: | ~/.cargo/registry/index @@ -38,12 +40,18 @@ jobs: cargo update -p time --precise 0.3.41 cargo update -p time-core --precise 0.1.4 - - name: Run cargo test - run: cargo test --all-features --all + - uses: actions/cache@v5 + name: Cache build dir + with: + path: target + key: tests-${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }} - name: Check default features run: cargo check --all + - name: Run cargo test + run: cargo test --all-features --all + lints: name: Lints and Breaking Changes runs-on: macos-latest @@ -59,6 +67,7 @@ jobs: components: clippy, rustfmt - uses: actions/cache@v5 + name: Cache crates.io with: path: | ~/.cargo/registry/index @@ -68,6 +77,14 @@ jobs: - name: DO NOT USE RUSTFMT run: "if cargo fmt --quiet --check -- --config-path=/dev/null; then echo >&2 'Do not reformat the code with rustfmt. This project does not use rustfmt.'; fi" + - run: cargo generate-lockfile + + - uses: actions/cache@v5 + name: Cache build dir + with: + path: target + key: lints-${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }} + - name: SemVer check uses: obi1kenobi/cargo-semver-checks-action@v2 @@ -88,12 +105,21 @@ jobs: target: aarch64-apple-ios,x86_64-apple-darwin - uses: actions/cache/restore@v5 + name: Cache crates.io with: path: | ~/.cargo/registry/index ~/.cargo/registry/cache key: cratesio-${{ runner.os }}-${{ hashFiles('Cargo.toml') }} + - run: cargo generate-lockfile + + - uses: actions/cache@v5 + name: Cache build dir + with: + path: target + key: lints-${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }} + - name: Run check iOS run: cargo check --all-features -p security-framework --target aarch64-apple-ios diff --git a/security-framework/src/os/macos/import_export.rs b/security-framework/src/os/macos/import_export.rs index 6cefb882..2ea6b61e 100644 --- a/security-framework/src/os/macos/import_export.rs +++ b/security-framework/src/os/macos/import_export.rs @@ -17,8 +17,7 @@ use crate::key::SecKey; use crate::os::macos::access::SecAccess; use crate::os::macos::keychain::SecKeychain; -// TODO: deprecate -#[doc(hidden)] +#[deprecated(note = "Obsolete. Use Pkcs12ImportOptions directly.")] /// Obsolete. Use Pkcs12ImportOptions directly. pub trait Pkcs12ImportOptionsExt { /// Specifies the keychain in which to import the identity. @@ -30,11 +29,14 @@ pub trait Pkcs12ImportOptionsExt { fn access(&mut self, access: SecAccess) -> &mut Self; } +#[allow(deprecated)] impl Pkcs12ImportOptionsExt for Pkcs12ImportOptions { + /// Moved to Pkcs12ImportOptions. Remove Pkcs12ImportOptionsExt trait. fn keychain(&mut self, keychain: SecKeychain) -> &mut Self { Self::keychain(self, keychain) } + /// Moved to Pkcs12ImportOptions. Remove Pkcs12ImportOptionsExt trait. fn access(&mut self, access: SecAccess) -> &mut Self { Self::access(self, access) }