Skip to content

Commit 46cf841

Browse files
committed
Add doc generator to the CI, add WASM target builder
1 parent a0a09ac commit 46cf841

File tree

7 files changed

+44
-9
lines changed

7 files changed

+44
-9
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
build:
14-
runs-on: ubuntu-latest
13+
test:
14+
name: Test on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ ubuntu-latest, windows-latest, macOS-latest ]
19+
1520
steps:
1621
- uses: actions/checkout@v5
1722

@@ -27,6 +32,26 @@ jobs:
2732
- name: Test with all features
2833
run: cargo test --all-features
2934

35+
build:
36+
name: Build for target ${{ matrix.target }}
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
target:
41+
- wasm32-wasip1
42+
43+
steps:
44+
- uses: actions/checkout@v5
45+
46+
- name: Add target
47+
run: rustup target add ${{ matrix.target }}
48+
49+
- name: Fetch dependencies
50+
run: cargo fetch
51+
52+
- name: Build for target
53+
run: cargo build --all-features --target ${{ matrix.target }}
54+
3055
format:
3156
runs-on: ubuntu-latest
3257
steps:
@@ -38,3 +63,9 @@ jobs:
3863
steps:
3964
- uses: actions/checkout@v5
4065
- run: cargo clippy --all-features -- -D warnings
66+
67+
docs:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v5
71+
- run: cargo doc --all-features --no-deps

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "darkbio-crypto"
3-
version = "0.6.4"
3+
version = "0.6.5"
44
authors = ["Péter Szilágyi <peter@dark.bio>"]
55
description = "Cryptography primitives and wrappers"
66
repository = "https://github.com/dark-bio/crypto-rs"
@@ -10,6 +10,7 @@ edition = "2024"
1010

1111
[package.metadata.docs.rs]
1212
all-features = true
13+
rustdoc-args = ["--cfg", "docsrs"]
1314

1415
[features]
1516
default = []

src/hpke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl Context {
243243
/// The method returns an encapsulated session key (which may be used for stream
244244
/// communication but this method does not need it) concatenated with the cipher-
245245
/// text with the encrypted data and authenticity proofs. To open it on the other
246-
/// side needs transmitting the <concat-session-key-ciphertext> and <msg_to_auth>.
246+
/// side needs transmitting the `concat-session-key-ciphertext` and `msg_to_auth`.
247247
///
248248
/// This method (and open) requires the public keys of both parties to be pre-
249249
/// shared. It is not suitable for a key exchange protocol!

src/hpke_cert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl PublicKey {
6767
///
6868
/// Note, this method is only for testing, most of the contained data will be
6969
/// junk; and also the produces certificate is not fully spec-adhering:
70-
/// https://github.com/indygreg/cryptography-rs/issues/26
70+
/// <https://github.com/indygreg/cryptography-rs/issues/26>
7171
pub fn to_test_cert_pem(&self, start: u64, until: u64, signer: eddsa::SecretKey) -> String {
7272
self.to_test_cert(start, until, signer)
7373
.encode_pem()
@@ -78,7 +78,7 @@ impl PublicKey {
7878
///
7979
/// Note, this method is only for testing, most of the contained data will be
8080
/// junk; and also the produces certificate is not fully spec-adhering:
81-
/// https://github.com/indygreg/cryptography-rs/issues/26
81+
/// <https://github.com/indygreg/cryptography-rs/issues/26>
8282
pub fn to_test_cert_der(&self, start: u64, until: u64, signer: eddsa::SecretKey) -> Vec<u8> {
8383
self.to_test_cert(start, until, signer)
8484
.encode_der()
@@ -89,7 +89,7 @@ impl PublicKey {
8989
///
9090
/// Note, this method is only for testing, most of the contained data will be
9191
/// junk; and also the produced certificate is not fully spec-adhering:
92-
/// https://github.com/indygreg/cryptography-rs/issues/26
92+
/// <https://github.com/indygreg/cryptography-rs/issues/26>
9393
pub fn to_test_cert(
9494
&self,
9595
start: u64,

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
// Use of this source code is governed by a BSD-style
55
// license that can be found in the LICENSE file.
66

7+
// Pull in the README as the package doc
78
#![doc = include_str!("../README.md")]
9+
// Enable the experimental doc_cfg feature
10+
#![cfg_attr(docsrs, feature(doc_cfg))]
811

912
#[cfg(feature = "cbor")]
1013
pub mod cbor;

src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// THE SOFTWARE.
2222

2323
//! I/O helper structs for age file encryption and decryption.
24-
//! https://github.com/str4d/rage/blob/main/age/src/primitives/stream.rs
24+
//! <https://github.com/str4d/rage/blob/main/age/src/primitives/stream.rs>
2525
2626
#![allow(clippy::all)]
2727

0 commit comments

Comments
 (0)