Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add justfile #1125

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 30 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
toolchain: nightly-2023-05-08
components: rustfmt
override: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Verify code formatting"
run: |
cargo +nightly-2023-05-08 fmt --check
run: just fmt-check

workflow-setup:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -109,11 +110,9 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
sudo snap install --edge --classic just
- name: "Verify clippy across the entire workspace with default features"
run: |
cargo clippy --examples --tests --all-features
env:
RUSTFLAGS: -D warnings
run: just clippy-workspace

aries_vcx_clippy:
runs-on: ubuntu-20.04
Expand All @@ -133,11 +132,9 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
sudo snap install --edge --classic just
- name: "Verify clippy across the entire workspace with default features"
run: |
cargo clippy -p aries_vcx --features legacy_proof --features ${{ matrix.backend }} --no-default-features
env:
RUSTFLAGS: -D warnings
run: just clippy-aries-vcx ${{ matrix.backend }}

aries_vcx_core_clippy:
runs-on: ubuntu-20.04
Expand All @@ -157,11 +154,9 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
sudo snap install --edge --classic just
- name: "Verify clippy across the entire workspace with default features"
run: |
cargo clippy -p aries_vcx_core --features legacy_proof,vdrtools_wallet --features ${{ matrix.backend }}
env:
RUSTFLAGS: -D warnings
run: just clippy-aries-vcx-core ${{ matrix.backend }}

##########################################################################################
############################## DOCKER BUILD ##########################################
Expand Down Expand Up @@ -272,8 +267,10 @@ jobs:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
skip-docker-setup: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run workspace unit tests"
run: RUST_TEST_THREADS=1 cargo test --workspace --lib --exclude aries-vcx-agent --exclude libvdrtools --exclude wallet_migrator --exclude mediator
run: just test-unit

test-integration-aries-vcx:
needs: workflow-setup
Expand All @@ -286,8 +283,10 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run aries-vcx integration tests"
run: cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdrtools_wallet,credx -- --ignored;
run: just test-integration-aries-vcx

test-integration-aries-vcx-anoncreds-rs:
needs: workflow-setup
Expand All @@ -300,8 +299,10 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run anoncreds-rs integration tests"
run: cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F anoncreds --test test_revocations --test test_proof_presentation --test test_anoncreds -- --ignored
run: just test-integration-aries-vcx-anoncreds-rs

test-integration-aries-vcx-mysql:
needs: workflow-setup
Expand All @@ -314,8 +315,10 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run aries_vcx tests: mysql_test"
run: cargo test --manifest-path="aries/aries_vcx/Cargo.toml" test_mysql -- --include-ignored;
run: just test-integration-aries-vcx-mysql

test-integration-aries-vcx-vdrproxy:
needs: [workflow-setup, build-docker-vdrproxy]
Expand All @@ -339,8 +342,10 @@ jobs:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
skip-vdrproxy-setup: false
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run aries_vcx tests: vdrproxy_test"
run: cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdr_proxy_ledger,credx -- --ignored
run: just test-integration-aries-vcx-vdrproxy
- name: "Collect docker logs on failure"
if: failure()
uses: ./.github/actions/upload-docker-logs
Expand All @@ -359,9 +364,10 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run libvcx_core integration tests"
run: |
RUST_TEST_THREADS=1 cargo test --manifest-path="aries/misc/legacy/libvcx_core/Cargo.toml" -- --include-ignored;
run: just test-integration-libvcx

test-integration-did-crate:
needs: workflow-setup
Expand All @@ -375,9 +381,10 @@ jobs:
with:
rust-toolchain-version: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
- name: "Install just"
run: sudo snap install --edge --classic just
- name: "Run resolver tests"
run: |
cargo test --examples -p did_doc -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov -p did_resolver_web -p did_doc_sov -p did_key -p did_peer --test "*"
run: just test-integration-did-crate

test-integration-node-wrapper:
needs: workflow-setup
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ debug = 0
panic = 'unwind'
incremental = false

[lints.clippy]
[workspace.lints.clippy]
all = "warn"
pedantic = "warn"
struct_excessive_bools = "allow"
Expand All @@ -60,7 +60,7 @@ match_bool = "allow"
no_effect_underscore_binding = "allow"
module_name_repetitions = "allow"

[lints.rust]
[workspace.lints.rust]
meta_variable_misuse = "warn"
missing_abi = "warn"
missing_copy_implementations = "warn"
Expand Down
3 changes: 0 additions & 3 deletions aries/agents/rust/mediator/src/didcomm_handlers/utils.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
pub mod prelude {
pub use std::sync::Arc;

pub use aries_vcx::utils::encryption_envelope::EncryptionEnvelope;
pub use aries_vcx_core::wallet::base_wallet::BaseWallet;

pub use crate::{aries_agent::ArcAgent, persistence::MediatorPersistence, utils::prelude::*};
}
61 changes: 61 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export RUSTFLAGS := "-D warnings"

default:
just --list

fmt:
cargo +nightly-2023-05-08 fmt

fmt-check:
cargo +nightly-2023-05-08 fmt --check

clippy-workspace:
cargo clippy --examples --tests --all-features

clippy-aries-vcx features:
cargo clippy -p aries_vcx --features legacy_proof --features {{features}} --no-default-features

clippy-aries-vcx-core features:
cargo clippy -p aries_vcx_core --features legacy_proof,vdrtools_wallet --features {{features}}

check-workspace:
cargo check --tests --all-features

check-aries-vcx:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" --all-features --tests

check-aries-vcx-anoncreds:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdrtools_wallet,anoncreds --tests

check-aries-vcx-credx:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdrtools_wallet,credx --tests

check-aries-vcx-core:
cargo test --manifest-path="aries/aries_vcx_core/Cargo.toml" --all-features --tests

check-aries-vcx-core-anoncreds:
cargo test --manifest-path="aries/aries_vcx_core/Cargo.toml" -F vdrtools_wallet,anoncreds --tests

check-aries-vcx-core-credx:
cargo test --manifest-path="aries/aries_vcx_core/Cargo.toml" -F vdrtools_wallet,credx --tests

test-unit:
RUST_TEST_THREADS=1 cargo test --workspace --lib --exclude aries-vcx-agent --exclude libvdrtools --exclude wallet_migrator --exclude mediator

test-integration-aries-vcx:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdrtools_wallet,credx -- --ignored

test-integration-aries-vcx-anoncreds-rs:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F anoncreds --test test_revocations --test test_proof_presentation --test test_anoncreds -- --ignored

test-integration-aries-vcx-mysql:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" test_mysql -- --include-ignored

test-integration-aries-vcx-vdrproxy:
cargo test --manifest-path="aries/aries_vcx/Cargo.toml" -F vdr_proxy_ledger,credx -- --ignored

test-integration-libvcx:
RUST_TEST_THREADS=1 cargo test --manifest-path="aries/misc/legacy/libvcx_core/Cargo.toml" -- --include-ignored

test-integration-did-crate:
cargo test --examples -p did_doc -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov -p did_resolver_web -p did_doc_sov -p did_key -p did_peer --test "*"
Loading