Skip to content

Commit

Permalink
Add justfile
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
  • Loading branch information
mirgee committed Feb 13, 2024
1 parent 52998fb commit 9946240
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 25 deletions.
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

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
58 changes: 58 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
export RUST_FLAGS := "-D warnings"

default:
just --list

fmt:
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 "*"

0 comments on commit 9946240

Please sign in to comment.