diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..3aa3436 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,34 @@ +name: rustdoc +on: + push: + branches: + - main + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUSTFLAGS: "-D warnings -W unreachable-pub" + RUSTUP_MAX_RETRIES: 10 + +jobs: + rustdoc: + if: github.repository == 'rust-lang/rust-analyzer' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Rust toolchain + run: rustup update --no-self-update stable + + - name: Build Documentation + run: cargo doc --no-deps --offline --workspace + + - name: Deploy Docs + uses: peaceiris/actions-gh-pages@364c31d33bb99327c77b3a5438a83a357a6729ad # v3.4.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./target/doc + force_orphan: true \ No newline at end of file diff --git a/cpe/src/lib.rs b/cpe/src/lib.rs index a0e962d..fb44849 100644 --- a/cpe/src/lib.rs +++ b/cpe/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/nvd-rs/0.0.1")] +#![doc(html_root_url = "https://emo-car.github.io/nvd-rs/cpe")] // Package wfn provides a representation, bindings and matching of the Well-Formed CPE names as per // https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf and // https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7696.pdf diff --git a/cve/src/lib.rs b/cve/src/lib.rs index 6852005..138dd34 100644 --- a/cve/src/lib.rs +++ b/cve/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/nvd-rs/0.0.1")] +#![doc(html_root_url = "https://emo-car.github.io/nvd-rs/cve")] pub mod cve; pub mod error; pub mod node; diff --git a/cvss/src/lib.rs b/cvss/src/lib.rs index 85df6ee..08f391b 100644 --- a/cvss/src/lib.rs +++ b/cvss/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/nvd-rs/0.0.1")] +#![doc(html_root_url = "https://emo-car.github.io/nvd-rs/cvss")] // 通用漏洞评分系统 // https://csrc.nist.gov/schema/nvd/feed/1.1-Beta/cvss-v3.x_beta.json // https://www.first.org/cvss/specification-document @@ -6,4 +6,4 @@ pub mod error; mod metric; pub mod v2; pub mod v3; -mod version; +pub mod version; diff --git a/src/lib.rs b/src/lib.rs index 4b3b378..4893d52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ #![doc( html_logo_url = "https://avatars.githubusercontent.com/u/30642514?s=360&v=4", - html_root_url = "https://docs.rs/nvd-rs/0.0.1" + html_root_url = "https://emo-car.github.io/nvd-rs" )] diff --git a/tests/tests.rs b/tests/tests.rs index 57846fd..c8a112d 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,7 +1,6 @@ #[cfg(test)] mod tests { use std::str::FromStr; - #[test] fn it_works() { let result = 2 + 2;