Skip to content

Commit 6a6d5d2

Browse files
committed
feat: add PIV and YubiKey hardware backends
1 parent b9f9d7a commit 6a6d5d2

33 files changed

Lines changed: 3038 additions & 51 deletions

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
2121
- name: Install system libraries
22-
run: sudo apt-get update && sudo apt-get install -y libssl-dev
22+
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpcsclite-dev
2323
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
2424
with:
2525
components: rustfmt, clippy
@@ -28,18 +28,25 @@ jobs:
2828
run: cargo fmt --all -- --check
2929
- name: Clippy
3030
run: cargo clippy --workspace --all-targets -- -D warnings
31+
# The default workspace build leaves the hardware-backend features off, so
32+
# lint the piv/yubikey code paths and their tests explicitly.
33+
- name: Clippy (hardware backends)
34+
run: cargo clippy -p rite-stdlib --features piv,yubikey --all-targets -- -D warnings
3135

3236
test:
3337
name: Test
3438
runs-on: ubuntu-latest
3539
steps:
3640
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
3741
- name: Install system libraries
38-
run: sudo apt-get update && sudo apt-get install -y libssl-dev
42+
run: sudo apt-get update && sudo apt-get install -y libssl-dev libpcsclite-dev
3943
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
4044
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
4145
- name: Test
4246
run: cargo test --workspace
47+
# piv/yubikey are off by default; run their action and backend tests.
48+
- name: Test (hardware backends)
49+
run: cargo test -p rite-stdlib --features piv,yubikey
4350

4451
msrv:
4552
# Verifies the MSRV floor declared on the library crates that are

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ jobs:
7373
key: release-${{ matrix.rust_target }}
7474

7575
- name: Build rite
76-
run: cargo build --release -p rite --target ${{ matrix.rust_target }} --features openssl-vendored
76+
# PC/SC is a system framework on macOS (PCSC.framework) and Windows
77+
# (WinSCard), so the native release binaries carry the piv/yubikey
78+
# backends. Only the static musl Linux tarballs stay software-only.
79+
run: cargo build --release -p rite --target ${{ matrix.rust_target }} --features openssl-vendored,piv,yubikey
7780

7881
- name: Build rite-ls
7982
run: cargo build --release -p rite-ls --target ${{ matrix.rust_target }}
@@ -104,6 +107,13 @@ jobs:
104107
steps:
105108
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
106109

110+
# The glibc `image` target compiles the arm64 binary under emulation, so
111+
# register QEMU binfmt explicitly rather than relying on the runner's
112+
# preinstalled handlers. The musl `binaries-*` targets cross-compile and
113+
# do not need it.
114+
- name: Set up QEMU
115+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
116+
107117
- name: Set up Docker Buildx
108118
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
109119

0 commit comments

Comments
 (0)