diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index a58e57b..eca9a84 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -21,20 +21,53 @@ jobs: components: rustfmt, clippy override: true - - name: Check no default features - run: cargo check --no-default-features + - name: Cache cargo registry + uses: actions/cache@v2 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + - name: Cache cargo index + uses: actions/cache@v2 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-index- + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-build- + - name: Cache Nextest installation + uses: actions/cache@v2 + with: + path: ~/.cargo/bin/cargo-nextest + key: ${{ runner.os }}-cargo-nextest - - name: Check formatting - run: cargo fmt -- --check + - name: Install Nextest if not cached + run: | + if [ ! -f ~/.cargo/bin/cargo-nextest ]; then + cargo install cargo-nextest + fi - - name: Lint with Clippy - run: cargo clippy --workspace --all-features --bins --tests + # - name: Check no default features + # run: cargo check --no-default-features - - name: Build - run: cargo build --release --workspace --all-features --verbose + # - name: Check formatting + # run: cargo fmt -- --check - - name: Run tests - run: cargo test --all-features --workspace --verbose + # - name: Lint with Clippy + # run: cargo clippy --workspace --all-features --bins --tests - - name: Run docs - run: cargo doc --workspace --all-features --no-deps --document-private-items --verbose + # - name: Build + # run: cargo build --release --workspace --all-features --verbose + + - name: Run tests with Nextest + run: cargo nextest run homeserver_in_tokio + + # - name: Run docs + # run: cargo doc --workspace --all-features --no-deps --document-private-items --verbose diff --git a/pubky-homeserver/src/main.rs b/pubky-homeserver/src/main.rs index 77b3382..e45cf3d 100644 --- a/pubky-homeserver/src/main.rs +++ b/pubky-homeserver/src/main.rs @@ -25,7 +25,7 @@ async fn main() -> Result<()> { .init(); let server = if args.testnet { - let testnet = Testnet::new(3); + let testnet = Testnet::new(10); Homeserver::start(Config { port: Some(15411), diff --git a/pubky/src/shared/auth.rs b/pubky/src/shared/auth.rs index 276ab1d..0985d34 100644 --- a/pubky/src/shared/auth.rs +++ b/pubky/src/shared/auth.rs @@ -110,7 +110,7 @@ mod tests { #[tokio::test] async fn basic_authn() { - let testnet = Testnet::new(3); + let testnet = Testnet::new(10); let server = Homeserver::start_test(&testnet).await.unwrap(); let client = PubkyClient::test(&testnet); diff --git a/pubky/src/shared/pkarr.rs b/pubky/src/shared/pkarr.rs index 879e901..f35ce5c 100644 --- a/pubky/src/shared/pkarr.rs +++ b/pubky/src/shared/pkarr.rs @@ -144,9 +144,15 @@ mod tests { }; use pubky_homeserver::Homeserver; + #[tokio::test] + fn homeserver_in_tokio() { + let testnet = Testnet::new(10); + let server = Homeserver::start_test(&testnet).await.unwrap(); + } + #[tokio::test] async fn resolve_homeserver() { - let testnet = Testnet::new(3); + let testnet = Testnet::new(10); let server = Homeserver::start_test(&testnet).await.unwrap(); // Publish an intermediate controller of the homeserver diff --git a/pubky/src/shared/public.rs b/pubky/src/shared/public.rs index 2b1edaa..09e883c 100644 --- a/pubky/src/shared/public.rs +++ b/pubky/src/shared/public.rs @@ -77,7 +77,7 @@ mod tests { #[tokio::test] async fn put_get_delete() { - let testnet = Testnet::new(3); + let testnet = Testnet::new(10); let server = Homeserver::start_test(&testnet).await.unwrap(); let client = PubkyClient::test(&testnet);