CTAP library move (#602)

* Moves all CTAP logic into its own library

* workflows fix test

* more coveralls workflow tests
This commit is contained in:
kaczmarczyck
2023-03-07 15:56:46 +01:00
committed by GitHub
parent 03031e6970
commit ca65902a8f
80 changed files with 412 additions and 2000 deletions

View File

@@ -22,6 +22,10 @@ jobs:
submodules: "true"
- name: Install Rust toolchain
run: rustup show
- name: Install nightly toolchain
run: rustup toolchain install nightly
- name: Install nightly cargo fmt
run: rustup component add rustfmt --toolchain nightly
- uses: actions/setup-python@v1
with:
python-version: 3.7
@@ -34,46 +38,59 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
args: -- --check
- name: Cargo format fuzz/
- name: Cargo format libraries/opensk
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path fuzz/Cargo.toml --all -- --check
args: --manifest-path libraries/opensk/Cargo.toml -- --check
- name: Cargo format libraries/opensk/fuzz
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path libraries/opensk/fuzz/Cargo.toml -- --check
- name: Cargo format libraries/cbor
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path libraries/cbor/Cargo.toml --all -- --check
args: --manifest-path libraries/cbor/Cargo.toml -- --check
- name: Cargo format libraries/cbor/fuzz
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path libraries/cbor/fuzz/Cargo.toml --all -- --check
args: --manifest-path libraries/cbor/fuzz/Cargo.toml -- --check
- name: Cargo format libraries/crypto
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path libraries/crypto/Cargo.toml --all -- --check
args: --manifest-path libraries/crypto/Cargo.toml -- --check
- name: Cargo format libraries/persistent_store
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path libraries/persistent_store/Cargo.toml --all -- --check
args: --manifest-path libraries/persistent_store/Cargo.toml -- --check
- name: Cargo format tools/heapviz
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --manifest-path tools/heapviz/Cargo.toml --all -- --check
args: --manifest-path tools/heapviz/Cargo.toml -- --check
- name: Cargo format bootloader
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path bootloader/Cargo.toml --all -- --check
args: --manifest-path bootloader/Cargo.toml -- --check

View File

@@ -11,6 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
toolchain: nightly
submodules: "true"
- name: Install Rust toolchain
run: rustup show
@@ -25,8 +26,8 @@ jobs:
run: ./fuzzing_setup.sh
- name: Cargo fuzz build
run: cargo fuzz build
run: cd libraries/opensk && cargo +nightly fuzz build
- name: Cargo fuzz build (libraries/cbor)
run: cd libraries/cbor && cargo fuzz build && cd ../..
run: cd libraries/cbor && cargo +nightly fuzz build
- name: Cargo fuzz build (libraries/persistent_store)
run: cd libraries/persistent_store && cargo fuzz build && cd ../..
run: cd libraries/persistent_store && cargo +nightly fuzz build

View File

@@ -3,7 +3,6 @@ name: OpenSK code coverage report
on:
push:
paths:
- 'src/**/*.rs'
- 'libraries/**/*.rs'
pull_request:
types: [opened, synchronize, reopened]
@@ -27,22 +26,24 @@ jobs:
- name: Set up OpenSK
run: ./setup.sh
- name: Install llvm tools
run: rustup component add llvm-tools-preview
run: rustup +nightly component add llvm-tools-preview
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo +stable install grcov; fi
- uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --features "with_ctap1,vendor_hid,ed25519,with_nfc,std" --no-fail-fast
args: --manifest-path libraries/opensk/Cargo.toml --features "std,with_ctap1,vendor_hid,ed25519" --no-fail-fast
env:
RUSTFLAGS: "-Zinstrument-coverage"
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "opensk-%p-%m.profraw"
- name: Run grcov
run: grcov . --binary-path ./target/debug/ --source-dir . --output-type lcov --ignore-not-existing ---output-path ./lcov.info --ignore "/*" --ignore "examples/*" --ignore "third_party/*"
run: RUSTUP_TOOLCHAIN=nightly grcov . --binary-path ./libraries/opensk/target/debug/ --source-dir libraries/opensk/ --output-type lcov --ignore-not-existing ---output-path ./lcov.info --ignore "/*" --ignore "examples/*" --ignore "third_party/*"
- uses: coverallsapp/github-action@1.1.3
name: upload report to coveralls
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"
base-path: "libraries/opensk"

View File

@@ -31,11 +31,13 @@ jobs:
- name: Unit testing of crypto library (release mode)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --manifest-path libraries/crypto/Cargo.toml --release --features std
- name: Unit testing of crypto library (debug mode)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --manifest-path libraries/crypto/Cargo.toml --features std

View File

@@ -29,24 +29,28 @@ jobs:
- name: Unit testing of CTAP2 (release mode)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --release --features std
args: --manifest-path libraries/opensk/Cargo.toml --release --features std
- name: Unit testing of CTAP2 (debug mode)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --features std
args: --manifest-path libraries/opensk/Cargo.toml --features std
- name: Unit testing of CTAP2 (release mode + CTAP1)
- name: Unit testing of CTAP2 (release mode + all features)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --release --features std,with_ctap1
args: --manifest-path libraries/opensk/Cargo.toml --release --features std,debug_ctap,with_ctap1,vendor_hid,ed25519
- name: Unit testing of CTAP2 (debug mode + CTAP1)
- name: Unit testing of CTAP2 (debug mode + all features)
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: test
args: --features std,with_ctap1
args: --manifest-path libraries/opensk/Cargo.toml --features std,debug_ctap,with_ctap1,vendor_hid,ed25519