Skip to content

Commit

Permalink
Add separate step to GHA workflow for rust doc (#116)
Browse files Browse the repository at this point in the history
* docs: add GHA workflow and silence warnings

* docs: add documentation workflow

* docs: add cargo test

* fix: copy over git config to workflow

* fix: switch to runner to github to get 1.60.0 rust
  • Loading branch information
DieracDelta authored Apr 8, 2022
1 parent 9a662e0 commit 98638f6
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 30 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,3 @@ jobs:
run: ./target/release/examples/dentry-simulator
env:
RUST_BACKTRACE: 1

- name: Generate Documentation
run: |
cargo doc --no-deps -p phaselock -p threshold_crypto --all-features
cp -R target/doc public
echo '<meta http-equiv="refresh" content="0; url=phaselock">' > public/index.html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: phaselock.docs.goespresso.com
44 changes: 44 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Documentation workflow
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Configure Git
run: |
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf git://github.com/
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf ssh://git@github.com/
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
override: true
default: true
components: rustfmt, clippy


- uses: Swatinem/rust-cache@v1
name: Enable Rust Caching

- name: Build Docs
run: |
cargo doc --no-deps --workspace --release --document-private-items --bins --examples --all-features
cargo test --doc --workspace --all-features
- name: Create documentation
if: ${{ github.ref == 'refs/heads/main' }}
run: |
cp -R target/doc public
echo '<meta http-equiv="refresh" content="0; url=phaselock">' > public/index.html
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions libp2p-networking/examples/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl web::WebInfo for CounterState {
}
}

/// Normal message. Sent amongst [`Regular`] and [`BootStrap`] nodes
/// Normal message. Sent amongst [`NetworkNodeType::Regular`] and [`NetworkNodeType::Bootstrap`] nodes
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub enum CounterRequest {
/// Request state
Expand All @@ -130,7 +130,7 @@ pub enum CounterRequest {
Kill,
}

/// Message sent between non-[`Conductor`] nodes
/// Message sent between non-[`NetworkNodeType::Conductor`] nodes
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub struct NormalMessage {
/// timestamp when message was sent
Expand All @@ -145,8 +145,8 @@ pub struct NormalMessage {
padding: Vec<u64>,
}

/// A message sent and recv-ed by a ['Regular'] or ['Bootstrap'] node
/// that is to be relayed back to a [`Conductor`] node
/// A message sent and recv-ed by a ['NetworkNodeType::Regular'] or ['NetworkNodeType::Bootstrap'] node
/// that is to be relayed back to a [`NetworkNodeType::Conductor`] node
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub struct RelayedMessage {
/// time message took to propagate from sender to recv-er
Expand All @@ -157,8 +157,8 @@ pub struct RelayedMessage {
epoch: (CounterState, CounterState),
}

/// A message sent and recv-ed by a ['Regular'] or ['Bootstrap'] node
/// that is to be relayed back to a [`Conductor`] node
/// A message sent and recv-ed by a ['NetworkNodeType::Regular'] or ['NetworkNodeType::Bootstrap'] node
/// that is to be relayed back to a [`NetworkNodeType::Conductor`] node
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
pub struct ConductorMessage {
/// the requeset the recv-ing node should make
Expand Down
2 changes: 1 addition & 1 deletion phaselock-utils/src/subscribable_mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<T> SubscribableMutex<T> {
}
}

/// Wait until `f` returns `true`. Signal on [`ready_chan`]
/// Wait until `f` returns `true`. Signal on `ready_chan`
/// once has begun to listen
async fn wait_until_with_trigger_inner<'a, F>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ fn generate_qc<'a>(
key_set.combine_signatures(signatures)
}

/// Load the latest [`QuorumCertificate`] and the relevant [`Leaf`] and [`State`] from the given [`Storage`]
/// Load the latest [`QuorumCertificate`] and the relevant [`Leaf`] and [`phaselock_types::traits::State`] from the given [`Storage`]
async fn load_latest_state<I: NodeImplementation<N>, const N: usize>(
storage: &I::Storage,
) -> std::result::Result<
Expand Down
4 changes: 2 additions & 2 deletions src/traits/storage/atomic_storage/hash_map_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ where
inner: RwLock<Inner<K, V>>,
}

/// The inner value of the [`RollingStore`]
/// The inner value of the [`HashMapStore`]
struct Inner<K, V>
where
K: Eq + Hash,
Expand All @@ -33,7 +33,7 @@ where
V: Clone,
HashMap<K, V>: Serialize + DeserializeOwned + Clone,
{
/// Load a `RollingStore` with the given loader and name.
/// Load a `HashMapStore` with the given loader and name.
///
/// # Errors
///
Expand Down

0 comments on commit 98638f6

Please sign in to comment.